Solution for “The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered” PowerShell Error in SharePoint 2013

We have a new SharePoint administrator who joined our team. We granted him access to all SharePoint servers, added him to the 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, he got the error message:

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

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

Solution: Grant Permissions to Run PowerShell Script on SharePoint

Basically, We have to grant “Shell Admin” access rights to be able to run PowerShell scripts in SharePoint. As the first step, add the new user to the “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 the WSS_ADMIN_WPG group in all of SharePoint front-end servers.

grant SharePoint_Shell_Access

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

Get-SPDatabase | Add-SPShellAdmin Domain\User

Important:
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 these rights during the 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 a new version of PowerShell?
In another scenario, We got this issue when the .Net framework and Windows Management framework update was installed. To resolve the issue, Just add “-version 2” to the “SharePoint 2010 Management Shell” link’s target field.

FROM:
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 ‘ “
TO:
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 ‘ “

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *