Skip to content
July 4, 2012 / red1s

SQL PowerShell permission authority issue


If you’ve ever had an issue with a Farm admin user not being able to run PowerShell on a SharePoint server the following post will assist you in doing so: (the post goes into other issues and their resolution but the main point is covered initially)

Investigation around this issue allows me to resolve it by updating the SQL permissions for the logged in user, to give them shell aces for the content database

http://www.sharepointassist.com/2010/01/29/the-local-farm-is-not-accessible-cmdlets-with-featuredependencyid-are-not-registered/

However when attempting to give the user the necessary access I received the following issue:

clip_image001

TITLE: Microsoft SQL Server Management Studio

——————————

Drop member failed for DatabaseRole ‘db_owner’. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+member+DatabaseRole&LinkId=20476

——————————

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

——————————

Cannot use the special principal ‘dbo’. (Microsoft SQL Server, Error: 15405)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=15405&LinkId=20476

An exception occurred while executing a Transact-SQL statement or batch.

Cannot use the special principal ‘dbo’.

I resorted to using the Add-SPShell admin to add the user the relevant rights

But received the following error:

image

Cannot add user to the SharePoint shell access role of the database.

a possible cause of this error is that the account name was already added to the database as a login using a different username than the current account.

After all of that I found the following link to resolve this issue:

http://alpesh.nakars.com/blog/powershell-to-give-farm-admin-shell-admin-access/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: