Skip to content

Instantly share code, notes, and snippets.

@rheid
Created March 16, 2014 16:47
Show Gist options
  • Save rheid/9586140 to your computer and use it in GitHub Desktop.
Save rheid/9586140 to your computer and use it in GitHub Desktop.
Function ChangeSiteCollectionAdministrators
{
Write-Host -Foregroundcolor green "- Changing the site collection administrators"
$site = Get-SPSite | ?{$_.Url -like "*sites/tempSite*"}
If ($site -ne $null)
{
Set-SPSite -Identity $site.Url -OwnerAlias "DOMAIN\farmacc" -SecondaryOwnerAlias "DOMAIN\svcacc"
Write-Host -Foregroundcolor white "- Site Collection Administrators for '$site' is changed."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment