This article describes how to manage a mailbox in the on-premises environment in the following scenario:
- An Office 365 mailbox exists.
- Active Directory synchronization is enabled.
- An on-premises mail-enabled user doesn't exist for the mailbox.
To manage a mailbox in the on-premises environment in the scenario that is described in the "Introduction" section, follow these steps:
- Use SMTP matching to match the Office 365 user account with an on-premises user account. To do this, see the following Microsoft Knowledge Base article:2641663 How to use SMTP matching to match on-premises user accounts to Office 365 user accounts for directory synchronization
- Convert the on-premises user account to a mail-enabled user. To do this, use Exchange Management Shell on the on-premises Microsoft Exchange server to run the following command:
Enable-MailUser -Identity User -ExternalEmailAddress <user>@<domain>.mail.onmicrosoft.com
- Obtain the Exchange GUID of the Office 365 mailbox. To do this, follow these steps:
- Connect to Microsoft Exchange Online by using remote PowerShell. For more information, go to the following Microsoft website:
- Run the following command:
Get-Mailbox -Identity <UserAlias>
- Update the on-premises mail-enabled user to use the Exchange GUID of the Office 365 mailbox. To do this, use Exchange Management Shell to run the following command:
Set-MailUser -Identity <UserAlias> -ExchangeGuid <Office365MailboxGUID>
- Move the mailbox from Office 365 to the on-premises domain. You can do this by using the Exchange Management Console or the Exchange Management Shell.
For example, use the Exchange Management Shell to run the following command:At the credential prompt, type the user name and password of the on-premises administrator to start the migration.
New-MoveRequest -Identity <UserAlias> -OutBound -RemoteTargetDatabase <OnPremisesDatabase> -RemoteHostName <mail.domain.com> -RemoteCredential (get-credential) -TargetDeliveryDomain <domain.com>