Skip to content

Instantly share code, notes, and snippets.

@AlexanderHolmeset
Created November 25, 2022 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexanderHolmeset/e85c7279bc9853d16fa3740f888fd01f to your computer and use it in GitHub Desktop.
Save AlexanderHolmeset/e85c7279bc9853d16fa3740f888fd01f to your computer and use it in GitHub Desktop.
$Sites = import-csv c:\temp\CopyContentOneDrive.csv -Delimiter ","
$tenantsource = Connect-Site -Url "https://contoso-admin.sharepoint.com" -Browser
foreach($site in $Sites){
Add-SiteCollectionAdministrator -SiteUrl $site.SourceSite -CentralAdmin $tenantsource
}
$tenantdest = Connect-Site -Url "https://tailspin-admin.sharepoint.com" -Browser
foreach($site in $Sites){
Add-SiteCollectionAdministrator -SiteUrl $site.DestinationSite -CentralAdmin $tenantdest
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment