Wednesday, December 3, 2014

SharePoint 2013: Cannot add to the SharePoint_Shell_Access role


You attempt to add a new SharePoint Management Shell administrator using the Add-SPShellAdmin commandlet, while logged in using an account that is a member of the local Administrator group.  Every time you attempt to run the commandlet, you experience the following error message presented in the shell:
"Cannot add <username> to the SharePoint_Shell_Access role of the database <farm configuration database>.  A possible cause of this error is that the account name was already added to the database as a login using a different user name than the account name."
In SQL Server Management Studio (SSMS), you check the login properties of the account and verify that it is currently mapped as DBO to the database.  Through SSMS, you try to uncheck the role membership, but experience an error.  You use the usual sp_changedbowner procedure, but without success. 

  1. Run SSMS as administrator.
  2. Right-click on the farm configuration database, and then choose Properties.
  3. Select the Files page.
  4. In the Owner field, change this to sa, and then click OK.
  5. Exit SSMS.
  6. Logon to any SharePoint server using the SharePoint Setup User Administrator account.
  7. Launch a SharePoint Management Shell as administator.
  8. Re-execute the Add-SPShellAdmin commandlet.

No comments: