Database is mandatory on UserMailbox

Had a call from our Service Desk today. They were trying to find a user whose mailbox is in Exchange Online, on the on-prem EAC, but it wasn’t showing the user (typically you’d see the user as an Office 365 account).

Cmdlets like Enable-RemoteMailbox didn’t work as it couldn’t find the user (and there was point running it either as the mailbox was already in O365 after all). Cmdlets like Get-User found the user but gave the above error.

In AD the msExchRemoteRecipientType attribute had a correct value of 4 (Migrated (User Mailbox)) and msExchRecipientTypeDetails a correct value of 2147483648 (RemoteUserMailbox). Nothing odd there either. Then I noticed the attribute msExchHomeServerName which was pointing to an on-prem mailbox. That didn’t make any sense. (Probably didn’t make sense to the Exchange server either lol).

So we removed that attribute and lo-and-behold EAC now sees the mailbox!

Googling on that bought me to this blog post which has more useful stuff (including a script). Check it out if you want to delve more into the topic.