Forum Discussion
Jay Christianson
May 17, 2017Copper Contributor
Powershell set -secondaryowneralias in SharePoint Online?
Need to add secondary site collection admins to all sites via poweshell command.
Various older posts I've found say that the old -secondaryowneralias doesn't work in Online.
Is there any new progress on this?
2 Replies
- Peter McDonaldIron Contributor$Sites = Get-SPOSite
Foreach ($Site in $Sites)
{
Write-host "Adding Site Collection Admin for:"$Site.URL
Set-SPOUser -site $SiteCollURL -LoginName $SiteCollectionAdmin -IsSiteCollectionAdmin $True
}
Read more: http://www.sharepointdiary.com/2015/08/sharepoint-online-add-site-collection-administrator-using-powershell.html#ixzz4hNYkwwAt- Peter's code should work like a charm :-)