Forum Discussion
birrdy_123
Feb 25, 2019Copper Contributor
Adding SharePoint Site Owner in PowerShell
Hi, I have made powershell script to provision modern team and communication sites. I have a share point list where user selects relevant information for this site. The user also selects the owner...
Djavan ROA
Feb 25, 2019Brass Contributor
Hi, have you tried using the "Set-SPOUser" from SPO Management Shell instead of PnP ?
https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/set-spouser?view=sharepoint-ps
Try:
Connect-SPOService -Url "https://somesite-admin.sharepoint.com/"
Set-SPOUser -LoginName "User@SomeSite.com" -IsSiteCollectionAdmin $true -Site $siteURL