Enable-RemoteMailbox is a powerful and useful command, sparing Exchange Hybrid admins the pain of creating and moving a local mailbox to Exchange Online. It does, however, have some issues occasionally – specifically when creating the required RemoteRoutingAddress.
From the official documentation, you get the provided example:
Enable-RemoteMailbox “Kim Akers” -RemoteRoutingAddress “kima@contoso.mail.onmicrosoft.com”
This usually works, however, from what I have seen, Exchange sometimes doesn’t treat the initial remote routing address as a distinct email address and it essentially disappears. It’s a bit quirky as Enable-RemoteMailbox doesn’t consume the EmailAddresses switch.
This is made more obvious in EAC, as the gui forces you to create the email address before it can be set as the Remote Routing Address.
If you have already created the remote mailbox, then you can run the command below to fix it up:
Set-RemoteMailbox -EmailAddresses @{add=”user@contoso.mail.onmicrosoft.com”} -RemoteRoutingAddress user@contoso.mail.onmicrosoft.com -identity <alias> -DomainController <FQDN of DC>
Another option is to run two separate Powershell commands when creating a remote mailbox. Note that the second one may fail if the DC you are connecting to isn’t aware of the remote mailbox object yet. You can get around this by using the same DC with the -DomainController switch or just waiting a bit and trying the second command again.
Enable-RemoteMailbox -identity <alias> -PrimarySmtpAddress user@contoso.com -RemoteRoutingAddress user@contoso.com -Alias alias -shared -DomainController <FQDN of DC>
You will notice I am setting the RemoteRoutingAddress to the primary SMTP address in the first command. I do that because you have to set it to something. I plan on setting that in the next step to the actual remote routing address.
I also like update the alias here as well to ensure it matches to the existing SamAccountName in Active Directory, otherwise you may find it set to the “User Logon Name”. Of course, you can set this to anything you want.
Both the -shared and -DomainController switches are optional and available in the latest supported Cumulative Updates for Exchange 2013 and above.
Once enabled, add the additional email address with the correct RemoteRoutingAddress.
Set-RemoteMailbox -EmailAddresses @{add=”user@contoso.mail.onmicrosoft.com”} -RemoteRoutingAddress user@contoso.mail.onmicrosoft.com -identity <alias> -DomainController <FQDN of DC>
The RemoteRoutingAddress can be anything unique. It’s typically “user@<tenant>.mail.onmicrosoft.com” and you should already have an existing On-Premises send connector to ensure messages are routed to the Exchange Online mailbox.
The remote mailbox now has the correct email and remote routing address set and, more importantly, they should stick! I have not tested this against Exchange 2019, but I would assume the issue is still there.
Happy Hybriding.
Thank you, this solved my problem!
LikeLike