Do you have an Exchange hybrid environment, and do you want to convert user mailbox…
You already did move mailboxes from Exchange on-premises to Exchange Online. What if you want to move a mailbox back to Exchange on-premises? The term is also known as offboarding a mailbox from the cloud. One of the reasons you wish to offboard a mailbox is that applications are not Office 365 ready, and you have to move the mailbox from Exchange Online to on-premises. In this article, we will look at how to move mailbox from Office 365 to on-premises with PowerShell.
Table of contents
How to move mailbox from Exchange Online
To move a mailbox from Exchange Online with PowerShell, follow the steps.
1. Connect to Exchange Online PowerShell
Start PowerShell as administrator and Connect to Exchange Online PowerShell.
PS C:\> Connect-ExchangeOnline
Note: You are not pushing the mailbox from on-premises to Exchange Online. In fact, you are pulling the mailbox from on-premises to Exchange Online. That’s why you need to connect to Exchange Online and run the commands from Exchange Online PowerShell.
2. Find migration endpoint remote server URL
Get the remote server URL by using the Get-MigrationEndpoint cmdlet. Read more about how to find RemoteHostName URL for mailbox migration. The Hybrid Configuration Wizard created this migration endpoint. Copy the RemoteServer URL as you will need it in the next part.
PS C:\> Get-MigrationEndpoint | Format-List Identity, RemoteServer Identity : Hybrid Migration Endpoint - EWS (Default Web Site) RemoteServer : mail.exoip.com
3. Move mailbox from Exchange Online with PowerShell
Create a new move request from Exchange Online. Fill in the following details:
- -Identity: Mailbox name or email address
- -RemoteTargetDatabase: Exchange on-premises mailbox database
- -RemoteHostName: The remote server that you copied in the previous step
- -TargetDeliveryDomain: Primary SMTP domain used for the Exchange Online organization mailboxes
- -RemoteCredential: On-premises administrator account with privileges
After running the cmdlet, a credential sign-in request will show up. Fill in the password of the on-premises credentials (RemoteCredential).
PS C:\> Get-Mailbox -Identity "Jordy.Twin@exoip.com" | New-MoveRequest -OutBound -RemoteTargetDatabase "DB01" -RemoteHostName "mail.exoip.com" -TargetDeliveryDomain "exoip.com" -RemoteCredential (Get-Credential exoip\administrator)
Get the status of the mailbox move request by using the Get-MoveRequest cmdlet.
PS C:\> Get-MoveRequest -Identity "Jordy.Twin@exoip.com" | Get-MoveRequestStatistics | ft DisplayName,StatusDetail,TotalMailboxSize,TotalArchiveSize,PercentComplete DisplayName StatusDetail TotalMailboxSize TotalArchiveSize PercentComplete ----------- ------------ ---------------- ---------------- --------------- Jordy Twin Completed 231.6 MB (242,877,775 bytes) 0 B (0 bytes) 100
The mailbox will complete.
If that is not the case and you can’t complete the mailbox move request, you can suspend and resume the move request. It helps in most situations when you get a failed status. For example, the status detail TransientFailure.
Did this article help you to offboard the mailbox from Exchange Online to Exchange on-premises with PowerShell? I hope it did.
You learned how to move a mailbox from Exchange Online to on-premises. Connect to Exchange Online PowerShell and run the cmdlet as shown in the article. Keep an eye if the mailbox move from Exchange Online successfully completed.
Did you enjoy this article? You may also like Move mailbox to Exchange Online with PowerShell. Don’t forget to follow us and share this article.