Sharepoint - Suddenly getting "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered."

Turns out the problem was caused by our wonderful operations guys ok'ing a windows update on our development machines.

The update in question is: Windows Management Framework 3.0 for Windows 7 SP1 and Windows Server 2008 R2 SP1

This update updates Powershell to a new version that uses .NET 4.xx and is not compatible with SharePoint 2010 resulting in the error described in the question.

There are two possible solutions.

  1. Add "-version 2" without the quotes to your Management shell link, to force running as an older version.
  2. Remove the update if you have no use for it, for other purposes.

So if you sudenly get this error on a server that has been running fine, check your Windows Updates.


In followup to @JoeJohnston answer crediting me: If you want to play by the rules you won't go modifying permissions on the SQL Server directly. Here is an alternate approach that may work for you, provide you already have one account that can use PowerShell to connect to the SharePoint farm. I haven't had occasion to try it directly.

From SharePoint TechNet article Add-SPShellAdmin

Use the Add-SPShellAdmin cmdlet to add a user to the SharePoint_Shell_Access role as follows:

  • If you specify only the user, the user is added to the role for the farm configuration database.
  • If you use the database parameter, the user is added to the role on the farm configuration database, the Central Administration content database, and the specified database. Using the database parameter is the preferred method because most of the administrative operations require access to the Central Administration content database.

With an example

Add-SPShellAdmin -UserName CONTOSO\User1 -database 4251d855-3c15-4501-8dd1-98f960359fa6


In my case the source of this exact error msg was that my Windows domain account was not granted rights to the SQL Server in the SharePoint farm. Once I used SSMS to add my account to the sysadmin role then the SP2010 management shell opened fine without this error. You may want to add this as an alternate stop-gap resolution.

Of course that begs the follow on question, why isn't my farm configured so adding my domain account to the usual AD groups makes everything right?

Credit John Calvert from a blog

Tags:

Powershell