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

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

I got “The local farm is not accessible. Cmdlets with Feature Dependency Id are not registered” when I tried to open SharePoint PowerShell.

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

In this post, we’re gonna fix the below SharePoint Farm Accessibility issue by going though the following:

You might also like to check PowerShell Script: SharePoint Farm Scan Report.

Applies To

  • SharePoint 2019.
  • SharePoint 2016.
  • SharePoint 2013.

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

The “local farm is not accessible. Cmdlets with FeatureDependencyId are not registered” issue usually occurs in case of

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

Run the SharePoint Management Shell as Administrator

  • Make sure that, you have run 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.

Steps

  • 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.
Grant SharePoint_Shell_Access Role on SharePoint_Config database
  • Reopen the SharePoint Management Shell.
  • The local farm should be accessible now!

Try now to open SharePoint PowerShell, the The local farm is not accessible. Cmdlets with Feature Dependency Id are not registered would be gone!

Set SharePoint_Shell_Access Role on SharePoint_Config database using Power-Shell

As an alternative solution, you can use the SharePoint PowerShell to provide a specific user a “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.
    • It’s preferred to use the farm account.
  • The current user is a member of the local administrator group.
    • Add the farm account temporarily to the local administrator group during running this cmdlet then remove it once you finish.
    • Note: don’t forget to restart the SharePoint timer service as mentioned at Restart SharePoint Timer Service From Command-Line.

Steps

  • Open Windows PowerShell as an administrator.
Run-Windows-PowerShell-as-Administrator
  • Run the below Cmdlets, one by one.
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$database = Get-SPDatabase | Where {$_.Name -eq "SharePoint_Config"}
Add-SPShellAdmin -UserName "Domain\User" -database $database
Cannot access the local farm using PowerShell SharePoint 2016

Don’t forget to provide your user name and the SharePoint configuration database name


Run the Old Version of SharePoint Management Shell

In some cases, if the issue “The local farm is not accessible. Cmdlets with Feature Dependency Id are not registered” not fixed that means it is not related to permissions, and maybe the PowerShell has been affected by a new applied update like .Net framework.

In this case, you have two options:

  • Remove the newly installed updates.
  • Or, run the SharePoint Shell with the 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 version 3 is not worked, try to use version 2.
Run SharePoint 2013 PowerShell in an old version
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 ' "
Run SharePoint 2016 PowerShell in an old version
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 an 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 as shown below.
Run SharePoint Management Shell with old version

Try again, the The local farm is not accessible. Cmdlets with Feature Dependency Id are not registered would be solved and the local farm should be accessible now!


Conclusion

In conclusion, we have solved “SharePoint The local farm is not accessible” in SharePoint PowerShell by providing the sufficient permissions and exploring other workarounds.

You may also like to read
Have a Question?

If you have any related questions, please don’t hesitate to ask it at deBUG.to Community.

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

  1. Pingback: SharePoint 2016: Convert Server Role to Web Front End With Distributed Cache Role | ITCore

Leave a Comment

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

Scroll to Top