Cannot migrate mailboxes from Office 365 to on-premises Exchange 2013

I have had many problems transferring mailboxes from Office 365 to my on-premises Exchange 2013 server. I enabled hybrid mode and configured DirSync and neither option helped. Here is the command I have been running on my on-premises server:

New-MoveRequest -Identity -Remote -RemoteHostName "" -TargetDeliveryDomain "" -RemoteCredential (Get-Credential)

I have tried several methods and run into a different error each time.

Scenario 1: Create user through ECP (user is also created in AD)
Result: Target user 'User' already has a primary mailbox.
    + CategoryInfo          : InvalidArgument: ( [New-MoveRequ
   t], RecipientTaskException
    + FullyQualifiedErrorId : [Server=EXCHANGE,RequestId=3140c245-b4d9-42be-bd5b-d91754259fef,TimeStamp=4/15/2015 4:17
   2 PM] [FailureCategory=Cmdlet-RecipientTaskException] 525A027C,Microsoft.Exchange.Management.RecipientTasks.NewMo
    + PSComputerName        : exchange.contoso.local

Scenario 2: Create user through AD without creating a mailbox
Result: The operation couldn't be performed because object '' couldn't be found on
    + CategoryInfo          : NotSpecified: (:) [New-MoveRequest], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : [Server=EXCHANGE,RequestId=df496aa2-919a-4736-b07b-622730628995,TimeStamp=4/15/2015 4:20
   3 PM] [FailureCategory=Cmdlet-ManagementObjectNotFoundException] 138F7556,Microsoft.Exchange.Management.Recipient
    + PSComputerName        : exchange.contoso.local

Scenario 3: Create user through ECP and manually clear msExch properties with ADSI (to work around another error where the Mailbox GUID was not found on premises)
Result: The critical property 'ExchangeGuid' is missing in the UserMailbox object 'User'.
    + CategoryInfo          : InvalidArgument: ( [New-MoveRequ
   t], RecipientTaskException
    + FullyQualifiedErrorId : [Server=EXCHANGE,RequestId=eb611fe2-3450-47f2-be76-08597e5ff2fc,TimeStamp=4/15/2015 3:50
   0 PM] [FailureCategory=Cmdlet-RecipientTaskException] A76AB784,Microsoft.Exchange.Management.RecipientTasks.NewMo
    + PSComputerName        : exchange.contoso.local

Am I missing something really obvious? I'm not sure if the on-premises AD needs user accounts created before moving the mailboxes or if the user shouldn't exist before moving or if the user does need to exist, but I need to configure it to allow a mailbox transfer.
Barry WhatleyIT ManagerAsked:
Who is Participating?
Vasil Michev (MVP)Commented:
You need to have mail users created on-prem, and you need to populate the ExchangeGUID.

There is a very detailed guide posted here:
AmitIT ArchitectCommented:
Watch this video for hybrid setup

Last part is live demo for hybrid setup.

I advise you to open MS case. As Office 365 servers are in MS control, they will be able help you easily.
Barry WhatleyIT ManagerAuthor Commented:
I've been having a problem setting the ExchangeGUID through Get-RemoteMailbox because the command cannot apparently see any of the mailboxes in AD. I was able to convert the GUID correctly to hexadecimal and manually change it using ADSI, but then I get the message that the user already has a primary mailbox. So with the wrong GUID, I get the error no mailbox with GUID could be found and with the correct GUID, it says the user already has a primary mailbox. Does Get-RemoteMailbox change something else other than the AD property?
Barry WhatleyIT ManagerAuthor Commented:
Figured it out. I was previously creating a user through ECP and it was creating a new mailbox. The trick mentioned on MSExchange was to create a new mail user. Creating the users this way allowed Office 365 to perform the migration with no problem.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.