4

How to add multiple site collection admins for a given site for secondary? I tried below but it replaces existing secondary. Any idea?

Set-SPSite –Identity $siteCollectionUrl –SecondaryOwnerAlias "domain\jdoe"
2
  • You can only have one primary and one secondary site collection administrator. You can add additional site administrators by going to Site Settings | Users and Permissions | Site Collections Administrators. Anyone added to this group that is not listed as the Primary or Secondary, though, will not receive email notifications, but will have full control of the site collection. Commented Oct 19, 2015 at 16:08
  • > There can be only 1 Secondary Site Collection administrator I disagree Asad. Browse to site collection URL, click settings (gear icon) > site settings. Under "Users and Permissions" click "Site collection administrators" Description on the page reads "Site Collection Administrators are given full control over all Web sites in the site collection. They may also receive site use confirmation mail. Enter users separated by semicolons." All of our site collections have 4 site collection administrators. I just can't figure out how to do it with Powershell.
    – Kerb
    Commented Dec 24, 2015 at 22:37

3 Answers 3

8

If both primary and secondary owners are set, the only other way to add additional Site Collection admins is to use the New-SPUser command and include the switch parameter -SiteCollectionAdmin.

New-SPUser -UserAlias 'Contoso\Jdow' -DisplayName 'Jane Dow' -Web 'http://contoso.com' -SiteCOllectionAdmin
0
2

If you need more than two Site Collection admins for every Site Collection in a Web App, try the following.

    $webApp = Get-SPWebApplication "http://mysite.sharepoint.com"

    Foreach($site in $webApp.Sites)
    {
      New-SPUser -UserAlias "domain\user" -DisplayName "User Name" -Web $site.URL
      $usr = Get-SPUser "domain\user" -Web $site.URL
      $usr.IsSiteAdmin = $true
      $usr.Update()
     }

Eric's example worked in my Dev environment, but not my Test environment. The example I provided works in both.

The example could be cleaned up to validate the user and validate if they are already a site admin.

1
  • As of 2021-05-27 this method fails with an error "The property 'IsSiteAdmin' cannot be found on this object." Commented May 27, 2021 at 7:10
-1

This would be easiest way with existing user for SharePoint Online:

$sites = gc sites.txt
foreach($site in $sites){set-spouser -Site $site -LoginName [email protected] -IsSiteCollectionAdmin $true}

This would be easiest way with existing user for SharePoint On-prem:

$sites = gc sites.txt
foreach($site in $sites)
{
   set-spuser -Web $site -Identity 'domain\alias' -IsSiteCollectionAdmin $true
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.