Skip to content

Instantly share code, notes, and snippets.

@AlexanderHolmeset
Created September 5, 2023 10:53
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/c937068b151e6b1fd72a3a172ebaa6ba to your computer and use it in GitHub Desktop.
Save AlexanderHolmeset/c937068b151e6b1fd72a3a172ebaa6ba to your computer and use it in GitHub Desktop.
$csvFile = "C:\temp\teamslist.csv"
#List of team object IDs. Header in CSV is ID.
$table = Import-Csv $csvFile -Delimiter ","
$source = Connect-Tenant -Domain contoso.onmicrosoft.com -Browser
$destination = Connect-Tenant -Domain tailspin.onmicrosoft.com -Browser
foreach ($row in $table) {
$team = Get-Team -id $($row.id) -Tenant $source
Copy-Team -Team $team -DestinationTenant $destination
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment