SharePoint Server: Add Site Collection Administrator to All Sites using PowerShell

Site collection administrators have God-like power within a Site Collection in SharePoint 2016. Apart from Primary and Secondary site collection administrators, we can add additional site collection administrators on any SharePoint site collection. When managing SharePoint sites, adding or removing site collection administrators is often necessary. This can be a time-consuming process if you need to do it for each site individually. This blog post will show you how to use PowerShell to add a site collection administrator to all sites in your SharePoint environment.

How to Add a Site Collection Administrator in SharePoint 2016?

To add a Site Collection Administrator, follow these steps:

  1. Site Settings Gear >> Click on “Site Settings” Menu Item
  2. Click on the “Site collection administrators” link under “Users and Permissions”
  3. Enter the New user in Site Collection Administrators Field. Click OK to save your changes.
    PowerShell to Add Site Collection Administrator to All Sites in SharePoint

OK! Now, How about adding the same user as an administrator in all site collections?

PowerShell Script to Add a Site Collection Administrator to All Site Collections in SharePoint:

If you manage multiple SharePoint sites, adding a site collection administrator to them can be helpful. This can be done quickly and easily with PowerShell.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#User Account to add as Site Collection Admin
$UserAccount="Crescent\Salaudeen"

Get-SPSite -Limit "All" | ForEach-Object { 
$User = $_.RootWeb.EnsureUser($UserAccount)
    if($User.IsSiteAdmin -ne $True)
    {
        $User.IsSiteAdmin = $True
        $User.Update()
        Write-Host "Added Site Collection Administrator for Site Collection:" $_.URL -ForegroundColor Green
    }
    else
    {
        Write-Host "User is already an Site Collection Administrator for Site Collection:" $_.URL -ForegroundColor Yellow
    }
} 
You can use Web Application User Policy in Central Admin to give Full control to the Entire web application, instead of adding users into individual site collections!

To add your account to all SharePoint Online sites in the Microsoft 365 environment, refer to How to Add Site Collection Admin to All Sites in the Tenant.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *