1

I want to know if I can set some configuration which would automatically add a user I specify as Site Admin to any new Site created.

I know that it is possible for MY sites but I want to know if I can do that for sites which are of the type

  • https://{tenantName}.sharepoint.com
  • https://{tenantName}.sharepoint.com/teams
  • https://{tenantName}.sharepoint.com/sites

Any help with this?

1 Answer 1

2

There isn't anything native to do this. We have it included as part of a provisioning commandlet that follows our business logic for quotas and architecture. You could do it like this using SharePoint Online PowerShell module to update existing sites, and just include the Set-SPOUser in your provisioning:

$sites = Get-SPOSite -limit all
foreach ($site in $sites){
    if ($site.Url -like "*/sites/*" -or $site.Url -like "*/teams/*" -or $site.Url -eq "https://yourtenant.sharepoint.com"){
        #$site.Url
        Set-SPOUser -Site $site -LoginName "[email protected]" -IsSiteCollectionAdmin
    }
}
4
  • But what about automatic addition to any new site created?
    – Akhoy
    Aug 3, 2015 at 17:05
  • There isn't anything like it, we have it included as part of a provisioning commandlet we have to set the SCAs after the site is created. Aug 3, 2015 at 17:08
  • Thanks alot! To sum it up, I'll have to periodically run this thing. Aug 3, 2015 at 18:02
  • Or just wrap the new-sposite command with your function and include the set-spouser, then provision new sites through powershell and not through the UI Aug 3, 2015 at 18:08

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.