Note: PowerShell integration requires a ShareGate Migrate Pro or Enterprise subscription. It is not available on the Essentials plan.
Command
New-TeamCopyOptions
Description
The command to create copy options when copying teams or team channels.
Note: with the -PostedMessagesMigrationStartDate parameter, ShareGate Migrate will migrate up to 500 messages in the post tab instead of the 50 messages limitation.
Examples
Create team copy options
$date = [DateTime]::ParseExact("01-31-2023", "MM-dd-yyyy", $null)
New-TeamCopyOptions -NoMessages -NoFiles -PostedMessagesMigrationStartDate $date -IncludeContentSensitivityLabel
Copy team with options
$options = New-TeamCopyOptions -NoApps -IncludeContentSensitivityLabel
$source = Connect-Tenant -Domain sourcetenant
$destination = Connect-Tenant -Domain destinationtenant
$team = Get-Team -Name "MyTeam" -Tenant $source
Copy-Team -Team $team -DestinationTenant $destination -CopyOptions $options
Copy team channels with options
$date = [DateTime]::ParseExact("01-31-2023", "MM-dd-yyyy", $null)
$options = New-TeamCopyOptions -NoMembership -PostedMessagesMigrationStartDate $date -IncludeContentSensitivityLabel -NoUserAvatarInMessages
$source = Connect-Tenant -Domain sourcetenant
$destination = Connect-Tenant -Domain destinationtenant
$sourceTeam = Get-Team -Name "MyTeam" -Tenant $source
$destinationTeam = Get-Team -Name "MyOtherTeam" -Tenant $destination
$sourceChannels = Get-TeamChannel -Team $sourceTeam
Copy-TeamChannel -Channel $sourceChannels -DestinationTeam $destinationTeam -CopyOptions $options
Incremental team copy with different options
$options = New-TeamCopyOptions -NoTabs -IncludeContentSensitivityLabel
$source = Connect-Tenant -Domain sourcetenant
$destination = Connect-Tenant -Domain destinationtenant
Copy-TeamIncremental -SessionId 211027-1 -SourceTenant $source -DestinationTenant $destination -CopyOptions $options
Syntax
New-TeamCopyOptions
[-NoMessages <SwitchParameter>]
[-NoPlannerPlans <SwitchParameter>]
[-NoFiles <SwitchParameter>]
[-NoTabs <SwitchParameter>]
[-NoApps <SwitchParameter>]
[-NoMembership <SwitchParameter>]
[-PostedMessagesMigrationStartDate <DateTime>][-IncludeStructureSensitivityLabel <SwitchParameter>][-IncludeContentSensitivityLabel <SwitchParameter>][-NoUserAvatarInMessages <SwitchParameter>]
New-TeamCopyOptions
[-NoMessages <SwitchParameter>]
[-NoPlannerPlans <SwitchParameter>]
[-NoFiles <SwitchParameter>]
[-NoTabs <SwitchParameter>]
[-NoApps <SwitchParameter>]
[-NoMembership <SwitchParameter>]
[-CopyPrivateChannelMembershipToPrivateTeamBehavior <CopyPrivateChannelMembershipToPrivateTeamBehavior {DontAddUsers | AddAllUsers}>]
[-PostedMessagesMigrationStartDate <DateTime>][-IncludeStructureSensitivityLabel <SwitchParameter>][-IncludeContentSensitivityLabel <SwitchParameter>][-NoUserAvatarInMessages <SwitchParameter>]
Parameters
-CopyPrivateChannelMembershipToPrivateTeamBehavior
Specifies the membership behavior for private channel members when copying inside a private team. AddAllUsers will add all private channel members to the private team, DontAddUsers will not.
Required? | False |
Default value | DontAddUsers |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | PrivateChannelMembership |
Aliases | None |
-IncludeContentSensitivityLabel <SwitchParameter>
Specifies that sensitivity labels applied to content - files stored in the team's document libraries (folders are excluded) - are copied to the destination using the persisted sensitivity label mapping. Both source and destination must be SharePoint Online.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-IncludeStructureSensitivityLabel <SwitchParameter>
Specifies that sensitivity labels applied to structure objects - the team's connected SharePoint site and document libraries - are copied to the destination using the persisted sensitivity label mapping. Both source and destination must be SharePoint Online.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NoApps <SwitchParameter>
Specifies to not copy the team's apps.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NoFiles <SwitchParameter>
Specifies to not copy the team's files.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NoMembership <SwitchParameter>
Specifies to not copy the team's membership.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NoMessages <SwitchParameter>
Specifies to not copy the team's messages.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NoPlannerPlans <SwitchParameter>
Specifies to not copy the team's Planner plans.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NoTabs <SwitchParameter>
Specifies to not copy the team's tabs.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NoUserAvatarInMessages <SwitchParameter>
Specifies not to copy the message authors' profile pictures when migrating channel messages.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
Note: this parameter is set on New-TeamCopyOptions, and will not work on Set-TeamChannelCopyOptions.
It suppresses avatars for the whole migration, and it applies to Copy-Team, Copy-TeamChannel, and Copy-TeamIncremental.
If you rerun Copy-TeamIncremental without its own -CopyOptions, the incremental copy will inherit this setting from the original session.
-PostedMessagesMigrationStartDate <DateTime>
Specifies the starting date from which the messages will be migrated in the Posts tab in Teams (up to 500 messages), while the rest will be in the message history tab.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
