Tuesday, June 21, 2016

Add Site Collection Administrator to All Sites in SharePoint using PowerShell

Site collection administrators have God like Power within a Site Collection in SharePoint 2016. Apart from Primary & Secondary site collection administrators, we can add additional site collection administrator on any SharePoint site collection.

How to Add a Site Collection Administrator in SharePoint 2016?
To Add a Site Collection Administrator follow these steps:

  • Site Settings Gear >> Click on "Site Settings" Menu Item
  • Click on "Site collection administrators link under "Users and Permissions"
  • 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 a same user as administrator in all site collections?

PowerShell Script to Add a Site Collection Administrator to All Site Collections in SharePoint:
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!



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...