Merge Exchange online Mailbox with on-premise AD account

One of my customer runs a hybrid exchange environment. By the onboarding process of new employees he needs to create the AD user and Mailbox onpremise.

After creating the Mailbox and if is needed (depends on Company Police) the Customer moves the Mailbox to the exchange online.

Here it is important to be sure that the right routing address is set and all works fine.

If you wanna know more about the Routing address, you can find my article about it here

 

In this Case for some reason, one of the Mailboxes was created wrong. That means,  the Mailbox was created directly in the Cloud.

Here that means that there was a User AD Object on premise but no Mailuser.

When the User was sending Mails (across the Cloud) he was able to send it with his Maildomain address.

But if someone tried to send him or answer him to his Mailaddress, he got the following Note:

This happened because there is no Mailuser on the onpremise side Exchange. The Exchange means that this Mail address don’t exists and refuse it to accept.

 

How to fix this issue?

EASYLY…

First we open a remote PowerShell connection to the Office 365 Tenant and run the following cmdlet:

We copy the displayed GUID of the Exchange online Mailbox.

Now we have to go to the onpremise Exchange and start the Exchange Management Shell. There we run the following cmdlet:

Now we are able to see in the Exchange Console under Recipient Configuration > Mail Contact the enabled Mailuser.

The next step, we need to change the GUID for the enabled Mailuser. The one we copied earlier today.

For that you simply run on the onpremise Exchange management shell the following cmdlet:

 

So what we did?

First cmdlet will create a mail-enabled object in Exchange on-prem and configure the target Address for remote routing and coexistence.

Second cmdlet sets the on-prem ExchangeGuid so it matches Office 365.

This will allow you to move the mailbox from Office 365 to on-prem (offboarding), if you ever want or need to do that.

As the last step is, we start a AD Sync on the AAD Connect server with the following cmdlet:

When sync is successfully done, Mailbox will work as expected.

I hope this solution will help you to fix this kind of issues, it is more smoother than to delete the Mailbox and recreate it.

 

 

 

 

Photo by Jonathan Borba on Unsplash


Leave a Reply

Your email address will not be published. Required fields are marked *