Partilhar via


SharePoint 2010 PowerShell or PowerShell ISE throwing - “The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.” when loading SharePoint PowerShell module

 

Recently I started facing this issue.

Whenever, I load the PowerShell ISE and Type the command to load the SharePoint PowerShell module, it starts throwing error

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

The same error comes up in the SharePoint Management Shell.

The reason could be you installed Windows Management Framework 3.0 via Windows Update or manually.

If you like Windows to automatically update in the background or you do it manually, but don’t read through each KB, the same could happen in your SP 2010 farm.

The KB that causes this is https://www.microsoft.com/en-us/download/details.aspx?id=34595.

It installs Windows Management Framework 3.0 and then PowerShell will start loading .Net framework 4.0.

SharePoint 2010 does not like .Net 4.0 and starts failing.

Resolution: https://support.microsoft.com/kb/2796733

OR

(What I have done)

Go to Control Panel –> Program & Features –> View Installed Updates and Search for the KB that corresponds to your Server’s patch version & uninstall that KB. Post uninstallation reboot the server.

· Windows Server 2008 R2 SP1

· 64-bit versions: Windows6.1-KB2506143-x64.msu

· Windows Server 2008 Service Pack 2

· 64-bit versions: Windows6.0-KB2506146-x64.msu

· 32-bit versions: Windows6.0-KB2506146-x86.msu

N.B. The above info is valid for SharePoint 2010 only.

Comments

  • Anonymous
    August 09, 2013
    Alternatively, switch to PS v2, by typing 'powershell -v 2', then re-add the SharePoint snapin. You could also add the --version parameter to the SharePoint Management Shell shortcut, so it always launches  in the correct version.
  • Anonymous
    September 13, 2013
    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?
  • Anonymous
    May 13, 2014
    Exactly what John described was my problem too. Thanks for the hint!
  • Anonymous
    September 03, 2014
    Old thread, I know, but if it's a permissions issue, you're better off granting access via Add-SPShellAdmin DOMAINUsernameSharePoint will add the appropriate roles to the user.  sysadmin is not required.  Of course, you have to have the rights to run that cmdlet.  But you can do it as the Farm account, if you don't have access to SQL Server (e.g. if there is a DBA who balks at the idea of granting sysadmin to the SharePoint admin).
  • Anonymous
    March 22, 2015
    Nice blog,if using SP 2010 SP2 with OS2012 SP1 need to usse below commandC:WindowsSYSTEM32WINDOWSPOWERSHELLV1.0PowerShell.exe -version 2.0 -NoExit " & ' C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14CONFIGPOWERSHELLRegistration\sharepoint.ps1' "Add –version 2.0 switch;