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

When I tried to open SharePoint Management Shell, I got the below error:

The local farm is not accessible. Cmdlets with Feature Dependency Id are not registered

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

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

The “local farm is not accessible” issue usually occurs in case of

  • The SharePoint Management Shell is not run as Administrator.
  • The current user don’t have sufficient permission on the SharePoint_Config database.
  • A new .Net framework update has been installed that affect the Power Shell version.

Run the SharePoint Management Shell as Administrator

  • Make sure that, you have ran the SharePoint Management Shell as Administrator as shown below.
Open SharePoint Shell as Administrator

Grant SharePoint_Shell_Access Role on SharePoint_Config database

If the issue still exists that means the current user doesn’t have SharePoint_Shell_Access role on the SharePoint_Config database.

  • Open SQL Management Studio > Connect to SQL Server.
Connect to SSMS
  • From Object Explorer > Security > Logins.
  • Right clicks on the current user > Properties.
    • If the current user is not found, you would add it.
  • From left side > click on the “User Mapping“.
  • Check “SharePoint_Config” database > Check SharePoint_Shell_Access role.
SharePoint Shell Access Role in SQL for SharePoint_Config
  • Reopen the SharePoint Management Shell.
  • The local farm should be accessible now!

Set SharePoint_Shell_Access Role on SharePoint_Config database using Power-Shell

As an alternative solution, you can use the SharePoint Power Shell to provide a specific user “SharePoint_Shell_Access” role.

This solution is preferred in case,

  • You don’t have access to the database server or SQL Server instance.
  • Your organization policy prevents to modify the database users Roles.

Also, this solution requires the below permissions:

  • The current user is a farm administrator (Use the farm account).
  • The current user is a member in local administrator group.
Steps
  • Open PowerShell as administrator.
  • Run the following Cmdlets, one by one.
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
Add-SPShellAdmin -UserName Domain\User

Run SharePoint Management Shell with old version

In some cases, the issue is not related to permissions, and may be the Power-Shell has been affected by an applied update.

In this case, you have two options:

  • Remove the newly installed update.
  • Or, run the SharePoint Shell with old version.

Steps

  • Get the current SharePoint Management Shell Target.
Run SharePoint Management Shell with old version
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe  -NoExit  " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "
  • Add the Version parameter -Version 3 before -NoExit, to looks like
    • Note: if the version 3 is not worked, try to use version 2.
SharePoint 2013
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version 3 -NoExit  " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "
SharePoint 2016
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version 3 -NoExit  " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "
  • Run CMD as administrator, then paste the above cmdlet to make sure that it’s working properly.
Run SharePoint Management Shell from Command Prompt
  • If the above cmdlet worked properly, so that, you should update the target with the correct version at.
Run SharePoint Management Shell with old version

Applies To
  • SharePoint 2016.
  • SharePoint 2013.
  • SharePoint 2010.
Conclusion

In this post, I have fixed the “The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered” issue.

See Also
Advertisements

2 thoughts on “The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered in SharePoint

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s