Add multiple secondary site collection admins
I needed a way to add multiple secondary site collection admins to a single SharePoint site with the use of PowerShell. The script below helps me with this. There are multiple ways of doing this however I found that using the PnP version enables to set the Secondary owner and not the default. You can use Set-SPOSite if you want to set the default site collection admin. ---------------------------------------------- #Admin Variables $Adminurl = "SharePoint admin URL" $adminAccounts = "Admin 1 comes here","Admin 2 comes here" #$cred = Get-Credential #Sitecollection $SiteCollection = read-host "Put your sitecollection URL here" #Connect to SPO $credential = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $SecurePWD Connect-PnPOnline -url $Adminurl -credential $cred write-host "Connected" -foregroundcolor green #Set secondary siteCollection Administrators of site collection Set-