Command
Copy-Mailbox
Description
The command to copy mailboxes from a Microsoft 365 tenant to another.
Examples
Copy a mailbox
$src = Connect-MicrosoftOnline $dst = Connect-MicrosoftOnline $copyOptions = New-MailboxCopyOptions -IncludeEmails -EmailCopyRangeStart (Get-Date).AddDays(-90) $mailboxesToCopy = Get-Mailbox -Connection $src -Id 272980f8-cba2-4b7f-b020-12ea922d92c5 $mappings = Import-MailboxMappings -SourceConnection $src -DestinationConnection $dst -Path "C:\mappings\SharegateMailboxesMapping.csv" Copy-Mailbox -SourceConnection $src -DestinationConnection $dst -CopyOptions $copyOptions -MappingSettings $mappings -Mailboxes $mailboxesToCopy
Syntax
Copy-Mailbox
-Mailboxes <Mailbox[]>
-SourceConnection <Connection>
-DestinationConnection <Connection>
-CopyOptions <MailboxCopyOptions>
-MappingSettings <MailboxMapping[]>
Parameters
-CopyOptions <MailboxCopyOptions>
Specifies the mailbox copy options.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-DestinationConnection <Connection>
Specifies the destination connection.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-Mailboxes <Mailbox[]>
Specifies the source mailboxes to copy.
Required? | True |
Default value | ShareGate.Mailboxes.Copy.Plugin.Automation.Mailboxes.Entities.Mailbox[] |
Accept pipeline input? | True (ByValue) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-MappingSettings <MailboxMapping[]>
Specifies the mapping settings.
Required? | True |
Default value | ShareGate.Mailboxes.Copy.Plugin.Automation.MailboxesMappings.Entities.MailboxMapping[] |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-SourceConnection <Connection>
Specifies the source connection.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |