Office 365 – Move a cloud Exchange user back to on-premise
To move a Mailbox from Exchange Online (o365) back to Exchange On-Premise has a few steps more involved. If you try move a mailbox from o365 back to exchange on-premise using the EAC on Office 365 it will fail, more below:
In this example, User5 was setup to move back to on-premise however after validation it fails with mailbox Guid error.
Here is the list of steps we are going to complete in order to get the mailbox to migrate back:
A) Check the Exchange GUID of the mailbox on the on-premise Exchange Server.
B) Connect to Azure-AD, New-PSSession, Import the PSSession and check the Exchange GUID in the cloud.
C) Check the ExchangeGUID of the Cloud Mailbox. You could also just copy the GUID in the error above as well.
D) Set the ExchangeGUID on-premise with the GUID from the Remote Mailbox.
E) Run a full sync from AAD Connect.
F) Perform Migration.
In Step A, on the Exchange Management Shell, we run the following command:
- Get-RemoteMailbox email@example.com | FL ExchangeGUID
This will give the result in the screenshot above, notice it shows 0’s.
In Step B, we will connect to Azure AD using the Windows Azure AD PowerShell Module.
The first command to run is “Connect-MsolService”, this will bring up the window as shown above and you can enter in your tenant login details. Once you have click OK and it will appear nothing happened but it has connected.
You can run the following commands:
- $UserCredential = Get-Credential
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
- Import-PSSession $Session
You can refer to this Technet article if you want to see the commands:
Now in Step C we can check the GUID of the Mailbox:
This is the command:
- Get-Mailbox firstname.lastname@example.org | fl exchangeGUID
In Step D we can now set the GUID on the Mailbox on your on-premise server. Open up the EMS and run the following command:
- Set-RemoteMailbox email@example.com -ExchangeGuid f64c7589-80d6-4a20-874d-dbef1e7be37e
In Step E we are going to run a sync so that o365 knows about the changes etc.
Once the Full sync has run we can now perform the migration.
On the Office 365 Tab, Select Recipients, Migration and then click the + button and choose the second option as per the screenshot above.
The New Migration Batch window opens, click the + button.
Now select the user, in this case it was User 5. Click Add ->
The user selected is now shown, click next to continue the off-boarding.
Enter in all the information required.
Give the move a friendly name, ensure that your domain is entered in step 2. To get your mailbox database you can run the command as in the PowerShell window behind the main screenshot to get the name. Click Next.
You can now click new to do the migration. Give it a few minutes depending on your connection to complete.
Now we can see that the migration completed successfully.
If we go back to our on-premise server now and check the user you will see that User 5 now is listed as a user mailbox type and you can see User 4 is listed as 365 mailbox type.
Hope it helps.