Last active
October 20, 2022 20:47
-
-
Save jamiechalmerzlp/65ad97c39e971d18134282102f7d7e65 to your computer and use it in GitHub Desktop.
Provides the ability to set an admin to every site in your SharePoint list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connect-PnPOnline -Url *sharepointadminurl* -Interactive | |
$Sites = Get-PnPTenantSite | |
for($x = 0; $x -lt $Sites.Count; $x++) { | |
Set-PnPTenantSite -Url $Sites[$x].Url -Owners "*adminemailaddress*" | |
Write-Host "Updating $($Sites[$x].Title), Site $($x)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment