Recently I experienced an error while trying to give SPShellAdmin access to an administrator. The admin was supposed to be added to a new content database in the SharePoint 2010 farm.
The steps I took are:
1. Opened SharePoint PowerShell and ran the following command to get the DatabaseID:
Copied the databaseID for the db I was going to add the user to.
2. Ran the following command to add the user:
Add-SPShellAdmin -UserName domain\username -database xxxxxx-c69-358e-4fc6-82a2-yyyyyyyy
3. Got the following error:
Add-SPShellAdmin : Some or all identity references could not be translated.
At line:1 char:17
+ Add-SPShellAdmin <<<< -UserName domain\username -database xxxxxx-c69-358e-4fc6-82a2-yyyyyyyy + CategoryInfo : InvalidData: (Microsoft.Share…AddSPShellAdmin:
SPCmdletAddSPShellAdmin) [Add-SPShellAdmin], IdentityNotMappedException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddSPShe
Well that the long and short of it tried all sort of combinations for try to get past the error but did not want to run the stsadm command as suggested by another post.
So here is the bit where I had to find an alternate solution. Remeber the user was already an aministrator and wanted to ShellAdmin access to the new content database.
1. Connect to the SQL Server that is hosting the content database.
2. Navigate to Security folder > Logins > Right click and Add the user if not user does not already exisit.
3. If the user exisits under Logins > RIght click the userID and select properties > Under User Mapping > Select the content Database and select “Public” role > Click on OK. Do not select “SharePoint_Shell_Access” at this stage.
4. Expand the SharePoint content database > Exapand Security folder > Expand Users folder > Right click and select Properties of user > Under Database role membership check “SharePoint_Shell_Access” and click OK.
5. Open PowerShell and type the command:
Get-SPShellAdmin -database xxxxxx-c69-358e-4fc6-82a2-yyyyyyyy
You should not get the new user listed under the Shell Admin.
Drop a feedback if this has saved your life. Always good to hear from the SharePoint world.