Cross-tenant mailbox migration with on-premise AD environment

Jack Chuong 436 Reputation points
2023-02-17T07:58:47.75+00:00

Hi all,
I'm planning to migrate mailbox from sub company tenant xyz.com --> my company tenant abc.com (more accurately is merging sub company xyz.com to my company abc.com)
Source tenant : xyz.com , Microsoft 365 , 100 users mailboxes , will be removed after migration/merging.
Target tenant : abc.com , Microsoft 365 with on-premise AD environment.
Requirement : Keep user mailbox data, do not use third-party migration tool.

I have read this article : Cross-tenant mailbox migration , here my plan in short :

  • Sub company tenant release domain xyz.com
  • Add domain xyz.com to my company tenant
  • Migrate mailboxes from sub company tenant to my company tenant following above article

My problems :

The article use New-MailUser and Set-MailUser to create and set attributes for users migrating, let's call it "MailUser" , these "MailUser" only exist on Microsoft 365 tenant , not on on-premise AD environment
get-user or get-mailuser "test migration user" | fl RecipientType*

RecipientType : MailUser

RecipientTypeDetails : MailUser

My company is using Microsoft 365 with on-premise AD environment , user is created on on-premise AD environment , synced to Microsoft 365 tenant by ADConnect , assigned Microsoft 365 license for creating mailbox...
I can control/modify user from on-premise AD environment and I want to keep it that way, I would like to use New-ADUser and Set-ADUser to create and set attributes for users migrating, let's call it "ADUser"
The article emphasized many times:

Users migrating must be present in the target tenant and Exchange Online system (as a MailUser)
For any mailbox moving from a source organization, you must provision a MailUser object in the Target organization

But "ADUser" cannot not be found by Get-MailUser command
Test-MigrationServerAvailability -EndPoint "Test Cross Tenant Mailbox Migration Endpoint" -TestMailbox "******@abc.com"

would failed and complain that '******@abc.com' couldn't be found.

Is there any way to : Convert "ADUser" --> "MailUser" and vice versa ?
My idea is : create "ADUser" , converto it to "MailUser" for migrating , then convert it back to "ADUser" after migration , to keep control it from on-premise AD environment

Or should I try my luck with "ADUser" ? Create Migration batch and hope it works ?

Please give me some advice, thank you very much.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,173 questions
Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. Kael Yao 37,746 Reputation points Moderator
    2023-02-24T08:21:47.4766667+00:00

    Hi @Jack Chuong,

    Thanks for the sharing! Glad to hear you have found a method working for you!

    While due to the forum policy, the original poster cannot accept his own reply as the answer to the question.

    I have written a summary for this question, please feel free to accept it as answer to highlight it to help other community members.

    Thanks again for your sharing.


    [Cross-tenant mailbox migration with on-premise AD environment]

    Scenario:
    migrate mailbox from sub company tenant xyz.com --> my company tenant abc.com (more accurately is merging sub company xyz.com to my company abc.com)
    Source tenant : xyz.com , Microsoft 365 , 100 users mailboxes , will be removed after migration/merging.
    Target tenant : abc.com , Microsoft 365 with on-premise AD environment.

    Requirement : Keep user mailbox data, do not use third-party migration tool.

    Resolution:
    I found a way : to migrate mailbox from source tenant : xyz.com --> target tenant : abc.com Microsoft 365 with on-premise AD environment
    Requirement :

    • Keep user mailbox data, do not use third-party migration tool
    • Map/Match mailbox with ADUser so I can modify/edit user's information from AD on premise.

    Here my plan in short :

    Step1: Follow this article : Cross-tenant mailbox migration , to migrate mailbox from source tenant : xyz.com --> target tenant : abc.com

    Step2: Put migrated mailbox to soft deleted by Remove-Mailbox command

    Step3: Create ADUser from AD on premise , sync ADUser to Microsoft 365 through ADConnect , assign Microsoft 365 license

    Step4: Reconnect soft deleted mailbox to ADUser

    [string]$oldguid=(Get-Mailbox -SoftDeletedMailbox -Identity ******@mydomaincom.mail.onmicrosoft.com).Guid
    [string]$newguid=(Get-Mailbox -Identity ******@mydomaincom.mail.onmicrosoft.com).Guid
    New-MailboxRestoreRequest -SourceMailbox $oldguid -TargetMailbox $newguid -AllowLegacyDNMismatch
    
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Jack Chuong 436 Reputation points
    2023-02-22T07:27:38.8833333+00:00

    I found a way : to migrate mailbox from source tenant : xyz.com --> target tenant : abc.com Microsoft 365 with on-premise AD environment
    Requirement :

    • Keep user mailbox data, do not use third-party migration tool
    • Map/Match mailbox with ADUser so I can modify/edit user's information from AD on premise.

    Here my plan in short :

    Step1: Follow this article : Cross-tenant mailbox migration , to migrate mailbox from source tenant : xyz.com --> target tenant : abc.com

    Step2: Put migrated mailbox to soft deleted by Remove-Mailbox command

    Step3: Create ADUser from AD on premise , sync ADUser to Microsoft 365 through ADConnect , assign Microsoft 365 license

    Step4: Reconnect soft deleted mailbox to ADUser

    [string]$oldguid=(Get-Mailbox -SoftDeletedMailbox -Identity ******@mydomaincom.mail.onmicrosoft.com).Guid
    [string]$newguid=(Get-Mailbox -Identity ******@mydomaincom.mail.onmicrosoft.com).Guid
    New-MailboxRestoreRequest -SourceMailbox $oldguid -TargetMailbox $newguid -AllowLegacyDNMismatch
    
    1 person found this answer helpful.
    0 comments No comments

  2. Kael Yao 37,746 Reputation points Moderator
    2023-02-20T07:55:29.74+00:00

    Hi @Jack Chuong,

    Since this is a complex scenario, please consider creating a service request in Microsoft 365 admin center to involve support for help.

    Thanks for your understanding.


    In my opinion, I would suggest creating a new mail user in Exchange Online and perform the cross-tenant migration, then sync this user back to on-premises.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Jack Chuong 436 Reputation points
    2023-02-20T09:29:25.2933333+00:00

    removed because duplicated

    0 comments No comments

  4. Jack Chuong 436 Reputation points
    2023-02-20T09:33:25.7666667+00:00

    deleted by jack chuong

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.