Sunday, January 29, 2012

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

Sometimes when you try to run a SharePoint 2010 Management Shell (PowerShell), you might encounter the error below.

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

clip_image002[8]

Although, the answer is not obvious given the error message, the answer is quite simple.  You tried to run PowerShell with a user account that is not an administrator in SharePoint.  In this case, I had ran it with my personal account which is not an admin and does not have access to the underlying SharePoint databases.  Hopefully, you used a “setup” account when you created SharePoint.  Execute PowerShell with that account instead. You can do this either by logging in as that user. You can also hold down the Shift key and right click on the SharePoint 2010 Management Shell icon and choose the Run as different user menu item.

clip_image004[4]

If you don’t have a setup account, things might be a bit trickier.  You can also resolve this by running it as the farm account, but you really want to try and avoid this. You can refer for the service accounts for SP2010 in MSDN for details of different service accounts.

Thanks for reading. If you have some other explanation – please post a comment… I’ll be happy to hear.

...HaPpY CoDiNg

Partha (Aurum)

References: