How to add Farm Account Shell Admin access to content databases?

ChingSong Lim 60 Reputation points
2024-05-07T01:18:10.12+00:00

Objective

  • To grant SharePoint Farm account Shell Admin to all the content databases.

Error

  • Highlighted in white are "Add-SPShellAdmin <FarmAccount>", "WSS_Content_Database".
  • User's image

Question

  1. How to give Farm account Shell Admin access to all the databases?

Thanks in advanced for the reply.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,243 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,793 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 42,341 Reputation points Microsoft Vendor
    2024-05-07T09:25:42.2266667+00:00

    You cannot add a user to the SharePoint_Shell_Access role in all content databases once by PowerShell.

    Here are examples:

    1.Add a new user named User1 to the SharePoint_Shell_Access role in the farm configuration database only.

    Add-SPShellAdmin -UserName CONTOSO\User1

    2.Add a new user named User1 to the SharePoint_Shell_Access role of both the specified content database and the configuration database

    Get-SPDatabase | ?{$_.Name -eq "WSS_Content"} | Add-SPShellAdmin -Username CONTOSO\User1


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.