Microsoft 365 Exchange Online Mailbox Created Before Being Created in On-Premise Exchange

So you created an Exchange Online User and Mailbox but you’re still in a hybrid configuration where you are managing Exchange mailboxes on-premise.

What this means is that the on-premise Exchange Organisation has no idea that the user exists, it doesn’t appear in Exchange Admin Center and it also probably won’t appear in the GAL.

It also means if you try to send to it from on-premise because it doesn’t exist in the Exchange Organisation on-premise, the message will be rejected (and not be delivered to the cloud), note however that the Exchange Online user will be able to send to on-premise Exchange mailboxes. But because the On-Premise Exchange Organisation hasn’t added the necessary mailbox attributes to the on-premise Active Directory account it won’t work sending the other way!

The following article provides some clues: https://techcommunity.microsoft.com/discussions/exchange_general/i-created-an-exchange-online-mailbox-but-it-doesnt-appear-in-on-prem-eac-how-do-/64542

Essentially on your on-premise Exchange you need to run the following. This retrospectively “mail-enables” the Active Directory user in the on-premise Exchange Organisation making it aware its actually a Microsoft 365 mailbox, without you needing to delete the mailbox (from Microsoft 365), then create it in the on-premise Exchange Organisation, then migrate it to the cloud.

So you do this to the existing Exchange Online mailbox, by running the following on your on-premise Exchange server (PowerShell):

Enable-MailUser -Identity <email address> –ExternalEmailAddress <onmicrosoft.com email address>

Enable-RemoteMailbox <username>

You then need to ensure your Entra Connect Sync runs and give it a few minutes for replications to happen within your on-premise AD and Entra (within Microsoft 365).

So with a worked example, if your user is called Fred Bloggs with the email address fb01@mydomain.com and their onmicrosoft.com email address is: fb01@mydomain.onmicrosoft.com you would do the following:

Enable-MailUser -Identity fb01@mydomain.com –ExternalEmailAddress fb01@mydomain.onmicrosoft.com

Enable-RemoteMailbox fb01

Now I also had a bit of a problem because my Hybrid Send Connector on-premise didn’t include the “mydomain.onmicrosoft.com” Address Space it only included the “mydomain.mail.onmicrosoft.com” Address Space.
(You find this on EAC -> Mail Flow -> Send Connectors then look for the one called “Outbound to Office 365 – <random letters and numbers>” then under “Scoping”.

What this meant was I had used the wrong “onmicrosoft.com” address, it should have been the following with (the “mail” included in there):

Enable-MailUser -Identity fb01@mydomain.com –ExternalEmailAddress fb01@mydomain.mail.onmicrosoft.com

Enable-RemoteMailbox fb01

Sure it worked without swapping to the mydomain.mail.onmicrosoft.com domain …. but what was happening was my on-premise Exchange was sending the message directly to fb01@mydomain.onmicrosoft.com out via the public Internet and our normal email routing rather than directly to Microsoft Exchange Online via the Hybrid Link (send connector scoped to that domain which in my case was mydomain.mail.onmicrosoft.com).

However, what you now have is a retrospectively mail enabled account for a Mailbox that was created directly in Microsoft Exchange Online and was never a pre-existing user mailbox in your on-premise Exchange.

Leave a comment