Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

This morning all the development machines at the company I work at, couldn't manage SharePoint through Powershell. We were all getting the annoying "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered." error.

A quick search has given me two causes for this error.

1: Wrong rights set for the user on the Config DB in SQL

2: Not running the Management Shell as Administrator

Neither of these two are the problem, since nothing has changed.

share|improve this question
1  
For me it turned out to be insufficient permissions on the configuration database in SQL. –  TempaC Mar 27 '13 at 9:12

5 Answers 5

up vote 18 down vote accepted

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.

share|improve this answer
    
Very interesting answer, because I was recently very tempted to move to PowerShell 3. i'll wait for my 2010 boxes :) –  Steve B Dec 13 '12 at 15:13
1  
Nice find! Good to know, will test PS3 on another machine... –  SPArchaeologist Dec 13 '12 at 15:29
1  
I love our operations guys... They flagged the update as important, so now the evil thing is back.. I love when stuff like this is handled by policy. –  Rasmus Dec 14 '12 at 7:33

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

share|improve this answer
    
That's me, thanks for the credit! –  JohnC 6 hours ago

I updated target in my run command to look like this:

C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version 2 -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\sharepoint.ps1 ' "

share|improve this answer

I came across this issue too today, here is the solution - http://blogs.technet.com/b/meamcs/archive/2013/02/18/sharepoint-powershell-command-problem-featuredependencyid-are-not-registered.aspx

You can alternatively open the SharePoint Management Shell as a user that does have Shell access to the SharePoint config DB and then run the command Add-SPShellAdmin DOMAIN\Username of the user that needs shell access.

share|improve this answer
    
JoeKir, Thanks for the post. But, we are not able to access the below link and it throws error. blogs.technet.com/b/meamcs/archive/2013/02/18/… –  user19320 Sep 4 '13 at 14:38

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.