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:

EXO1

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.

EXO2

In Step A, on the Exchange Management Shell, we run the following command:

  • Get-RemoteMailbox user5@thexchangelab.co.za | 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.

EXO3

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.

EXO4

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:

  • https://technet.microsoft.com/library/jj984289(v=exchg.160).aspx

Now in Step C we can check the GUID of the Mailbox:

EXO5

This is the command:

  • Get-Mailbox user5@thexchangelab.co.za | 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 user5@thexchangelab.co.za -ExchangeGuid f64c7589-80d6-4a20-874d-dbef1e7be37e

In Step E we are going to run a sync so that o365 knows about the changes etc.

EXO6

Once the Full sync has run we can now perform the migration.

EXO7

On the Office 365 Tab, Select Recipients, Migration and then click the + button and choose the second option as per the screenshot above.

EXO8

The New Migration Batch window opens, click the + button.
Now select the user, in this case it was User 5. Click Add ->
Click Ok.

EXO9

The user selected is now shown, click next to continue the off-boarding.

EX10

Click next.

EX11

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.

EX12

You can now click new to do the migration. Give it a few minutes depending on your connection to complete.

EX13

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.

EX14

Hope it helps.

Views All Time
Views All Time
Views Today
Views Today

Leave a Reply

Your email address will not be published. Required fields are marked *