Blog/Migrations

Cross-tenant mailbox migration, end to end

The native Exchange Online path from trust setup to cutover, with every step, the PowerShell behind it and the checks that stop a wave failing on the night.

MigrationsExchange
Applies toExchange Online, both tenants
ToolingNative, first party
Typical wave250 mailboxes
Effort1 day setup, then per wave

How it works

Native cross-tenant migration moves a mailbox with the same Mailbox Replication Service that Exchange Online uses for onboarding. The target tenant pulls the mailbox. The source tenant decides who can be pulled, through an organization relationship scoped to one mail-enabled security group. Each person needs an empty MailUser in the target, stamped with values from the source mailbox, for the mailbox to land on.

Source tenantTarget tenant1Register migrationappMailbox.Migration2Admin consentGlobal Administrator3Org relationship +endpointInbound4Org relationship +scope groupRemoteOutbound5Stamp MailUsersGUIDs, x5006Create batchAutoStart7Sync to SyncedDaily delta8CutoverComplete batch9Permissions + checksDelegation, forwarding
Trust is set up once. Steps 5 to 9 repeat for every wave.

Before you start

RequirementWhereWhy it matters
Cross-Tenant User Data Migration licenceOne per migrated userWithout it the move is refused.
Exchange AdministratorBoth tenantsCreates the relationships, endpoint, MailUsers and batches. Activate it through PIM.
Global Administrator (once)Source tenantGrants consent to the target migration app.
Mail-enabled security groupSource tenantLimits which mailboxes can be pulled. Add each wave just before it runs.
Target MailUser per personTarget tenantThe empty object the mailbox moves into. No mailbox may exist there yet.
Mapping fileYour project shareSource address, target address, and the values pre-flight compares.
See how the migration licence appears in LicensesLearn console · Admin center › Licenses

Set up the trust (once)

  1. 1

    Register the migration app in the target

    Target

    Create an app registration, add the Office 365 Exchange Online application permission Mailbox.Migration, and create a client secret. Keep the secret in your vault, never in a script.

    Expected result: The app shows Mailbox.Migration under API permissions.

  2. 2

    Get consent from the source

    Source

    Send the admin consent URL for the app to a Global Administrator of the source tenant. Until consent is granted every endpoint test fails with an authorization error.

    PowerShell · Source
    # Consent URL to send to the source Global Administrator
    "https://login.microsoftonline.com/kestrel.onmicrosoft.com/adminconsent?client_id=$AppId&redirect_uri=https://office.com"

    Expected result: The app appears under Enterprise applications in the source tenant.

  3. 3

    Create the target organization relationship

    Target

    The target accepts inbound moves from the source tenant ID.

    PowerShell · Target
    New-OrganizationRelationship -Name "From-Kestrel" -DomainNames $SourceTenantId `
      -MailboxMoveEnabled $true -MailboxMoveCapability Inbound
  4. 4

    Create the source organization relationship and scope group

    Source

    The source allows outbound moves only to the target, only through the app, and only for members of the scope group.

    PowerShell · Source
    New-DistributionGroup -Name "XTM-Wave-Scope" -Type Security
    New-OrganizationRelationship -Name "To-Harbor" -DomainNames $TargetTenantId `
      -MailboxMoveEnabled $true -MailboxMoveCapability RemoteOutbound `
      -OAuthApplicationId $AppId -MailboxMovePublishedScopes "XTM-Wave-Scope"
  5. 5

    Create and test the migration endpoint

    Target

    The endpoint holds the source tenant name and the app. Test it before every wave, because a rotated secret fails silently until a batch starts.

    PowerShell · Target
    New-MigrationEndpoint -Name "XT-Kestrel" -RemoteServer outlook.office.com `
      -RemoteTenant "kestrel.onmicrosoft.com" -Credentials $AppCredential `
      -ApplicationId $AppId -ExchangeRemoteMove:$true
    Test-MigrationServerAvailability -Endpoint "XT-Kestrel" -TestMailbox "asha@harbor.com"

    Expected result: Result: Success.

Prepare each wave

  1. 1

    Add the wave to the scope group

    Source

    Only members of the scope group can be moved. Adding a wave just before it runs means nobody else can be pulled by mistake.

    PowerShell · Source
    Import-Csv .\B07.csv | ForEach-Object { Add-DistributionGroupMember "XTM-Wave-Scope" -Member $_.SourceUPN }
  2. 2

    Stamp the target MailUsers

    Target

    Copy ExchangeGuid, ArchiveGuid (when there is an archive) and the source LegacyExchangeDN as an x500 address onto each MailUser. Add the source x500 proxies too, so old replies and meeting updates still resolve.

    PowerShell · Target
    $m = Get-Mailbox asha@kestrel.com   # run in the source, export to CSV
    Set-MailUser asha@harbor.com -ExchangeGuid $m.ExchangeGuid -ArchiveGuid $m.ArchiveGuid `
      -EmailAddresses @{ add = "x500:$($m.LegacyExchangeDN)" }

    Expected result: Get-MailUser shows the same ExchangeGuid as the source mailbox.

  3. 3

    Run pre-flight

    Both

    Check every user: source mailbox found, target MailUser found, GUIDs match, x500 present, no mailbox already in the target, licence assigned, holds reported. Remove blocked users from the CSV and record the reason.

  4. 4

    Export delegation and forwarding

    Source

    Full Access, Send As and Send on Behalf do not move with the mailbox. Export them now so you can re-apply them after cutover.

    PowerShell · Source
    Get-MailboxPermission finance@kestrel.com |
      Where-Object { -not $_.IsInherited -and $_.User -notlike "NT AUTHORITY*" }
    Get-RecipientPermission finance@kestrel.com | Where-Object Trustee -ne "NT AUTHORITY\SELF"

Run the migration

  1. 1

    Create the batch

    Target

    Start automatically and complete manually. Name the batch so the whole team can find it: date, tooling, batch, sub-batch, region.

    PowerShell · Target
    New-MigrationBatch -Name "20261128-EXO-NATIVE-B07-S1-INDIA" -SourceEndpoint "XT-Kestrel" `
      -CSVData ([System.IO.File]::ReadAllBytes("C:\Waves\B07.csv")) `
      -TargetDeliveryDomain "harbor.onmicrosoft.com" -AutoStart

    Expected result: Batch status moves to Syncing within minutes.

  2. 2

    Monitor until Synced

    Target

    Send the in-progress report every morning. Fix Failed users the same day; most are GUID mismatches, a missing licence or a user outside the scope group.

    PowerShell · Target
    Get-MigrationUser -BatchId "20261128-EXO-NATIVE-B07-S1-INDIA" -ResultSize Unlimited | ForEach-Object {
      Get-MigrationUserStatistics $_.Identity | Select Identity, Status, PercentageComplete, ErrorSummary }
  3. 3

    Handle skipped items

    Target

    Users with too many corrupt or oversized items stop at NeedsApproval. Review what was skipped, record who approved, then approve.

    PowerShell · Target
    Set-MigrationUser asha@harbor.com -ApproveSkippedItems
  4. 4

    Remove failed users, then cut over

    Target

    Take failed users and the business removal list out of the batch, then complete it in the agreed window.

    PowerShell · Target
    Remove-MigrationUser kabir@harbor.com -Confirm:$false
    Complete-MigrationBatch -Identity "20261128-EXO-NATIVE-B07-S1-INDIA"

    Expected result: Every remaining user reaches Completed.

After cutover

  1. 1

    Re-apply permissions

    Target

    Map each owner and delegate to their target address, apply, then read them back. List any delegate who is not in the mapping file instead of guessing.

    PowerShell · Target
    Add-MailboxPermission finance@harbor.com -User asha@harbor.com -AccessRights FullAccess
    Add-RecipientPermission finance@harbor.com -Trustee asha@harbor.com -AccessRights SendAs -Confirm:$false
  2. 2

    Check forwarding

    Target

    Remove forwards that point back to the source tenant or outside the company.

  3. 3

    Hand over to the endpoint team

    Both

    Send the Completed list so devices, Outlook profiles and mobile apps follow the mailbox.

Troubleshooting

SymptomLikely causeFix
Failed within minutesExchangeGuid or ArchiveGuid mismatchRe-stamp the MailUser from the source values and resume.
Endpoint test: access deniedConsent missing or secret expiredRe-consent in the source or rotate the secret, then update the endpoint.
User not found in sourceUser is not in the scope groupAdd to the scope group, wait for replication, resume.
Target already has a mailboxExchange licence assigned too earlyRemove the licence, wait for the mailbox to clear, re-stamp.
NeedsApprovalSkipped items over the limitReview skipped items and approve.

Get the next guide by email

The Cutover is a monthly email with new guides and what we learned on recent waves.

Related

GuideMigrationsSharePoint & OneDrive

Moving OneDrive between tenants with the native tool

Trust, identity map, the move itself and the one rule that decides whether a user goes native or to a third-party tool.

17 Nov 202614 min read
GuideMigrationsIntune

Device migration between tenants: three paths and when to use each

There is no native button to move an Intune device to another tenant. How to choose between a reset, an Autopilot re-registration and a profile move, and the exact steps for each.

10 Nov 202612 min read
GuideEntra IDMigrations

Set up PIM before the migration starts

Engineers need Exchange and SharePoint admin rights in two tenants. Make them eligible, not permanent, and keep a clean audit trail.

3 Nov 20269 min read