Tuesday, April 6, 2010

Installation Account can't run SharePoint PowerShell cmdlets, Round 2

Part 1

Okay, explored this a little further since the error about needing to be Farm Administrator to run some cmdlets when you were, in fact, a Farm Administrator was bugging me.

I created a new account, sp_Farmadmin2. I added him to the Administrators group on my SharePoint server. Logged in as him and tried to run the SharePoint 2010 Management Shell and got my familiar error, "The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered". Note that it would also not work if I right clicked and chose "Run as Administrator".

I then ran the Add-SPShellAdmin command and specified sp_Farmadmin2. Switched back to sp_Farmadmin2 and tried to run the SharePoint 2010 Management Shell again. Same error. However, this time when I right clicked and chose "Run as Administrator", it worked.

Note that sp_Farmadmin2 is NOT a member of the WSS_Admin_WPG group in Active Directory. Nor are they a member of the the Farm Administrators group in SharePoint, though as an administrator for the machine, they can get into Central Administration.

It seems there are only three keys to getting the cmdlets to work:
  1. Must be an administrator on the SharePoint server.
  2. Must be in the SharePoint_Shell_Access role in the SP_Config database.
  3. Must right-click and chose "Run as Administrator" to start the SharePoint 2010 Management Shell.

No comments:

Post a Comment