Friday, July 18, 2014

"The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered" PowerShell Error Solution in SharePoint 2013/2010

We have a new SharePoint administrator joined in our team. We granted him access to all SharePoint servers, Added him to Farm Admin group, Web application policy. 

However, when he tried launching SharePoint Management Shell or try adding the SharePoint PowerShell snap-in from PowerShell ISE, got the error message:

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

Solution: Grant Permissions to Run PowerShell Script on SharePoint 2013/2010
Basically, We've to grant "Shell Admin" access rights to be able to run PowerShell scripts in SharePoint. As the first step, Add the new user to "Local Administrator" group of the SharePoint WFE/App Servers. Login as with Farm Admin access rights and run:
Add-SPShellAdmin Domain\User
This cmdlet grants "SharePoint Shell Access" membership rights on the SharePoint Farm configuration database and adds the user under WSS_ADMIN_WPG group in all of SharePoint front end servers.

While the above cmdlet gives access to SharePoint Management shell, You have to grant access to all SharePoint databases as well:

Get-SPDatabase | Add-SPShellAdmin Domain\User

The Account in which you are running the above PowerShell cmd-lets should have "DB Creator" and "Security Admin" server roles in SQL Server and Local Administrator of the server from which you're running the cmdlet. By default, The Farm Admin account is granted with these rights during initial farm setup.

To get the list of all the users having the "SharePoint_Shell_Access" role, use the Get-SPShellAdmin. To delete a user from the "SharePoint_Shell_Access" role, use the Remove-SPShellAdmin .

Last but not least: You may also receive this error when UAC is turned ON. Use "Run as Administrator" on SharePoint Management Shell to overcome "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered" error! 

Another case: Have you installed new version of PowerShell?
In an another scenario, We got this issue when the .Net framework and Windows Management framework update is installed. To resolve the issue, Just add "-version 2" to the "SharePoint 2010 Management Shell" link's target field.

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

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.

Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...