Sharepoint - Powershell: cannot access the local farm

Found it. My account needed proper rights in SQL Server, per this post:

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.

It worked once I set "Sharepoint_Shell_Access" to the Sharepoint_Config database.

What got me here was searching for the first message: "the local farm is not accessible"


Perform the following script in the SharePoint Management Shell, as a farm administrator and it will remove the error.

Get-SPDatabase | Add-SPShellAdmin SomeDomain\SomeUserName

This will grant the user both access to the configuration database as well as the content database.

Alternatively, you can revoke that granted access with the opposite command.

Get-SPDatabase | Remove-SPShellAdmin SomeDomain\SomeUserName

I know you are a farm admin, but try right clicking on Powershell, and select 'Run as Administrator'

Tags:

Powershell