Picture this scenario, you have hired a contractor to do some work for yourselves. While at your company they use outlook as any person would, however after a while they leave the company. A lot of our customers use retention policies that cover accidental deletion therefore when they leave their mailbox will be disconnected and stay in soft deleted mailboxes. If they rejoin you will of course need to give them a fresh license via the Office 365 Admin portal however when this happens you get the error ‘Exhcange: An unknown error has occured. Refer to correlation ID: <correlation ID>’. You will receive this message because you now have two archives, one online and one object on-prem and because of this the archive guid’s conflict. To fix this do the following:

  1. On the office 365 portal find the user and in the licenses section remove the ‘Exchange Online (plan 2)’ and save, once this is done run an AD  Sync cycle from your AAD Sync server. (this will ensure no new mailboxes are created while you are fixing the current one).#
  2.  Go onto your on-prem exchange server and open up the exchange management console, from here you need to find the user and right click ‘disable’ not ‘remove’.
  3. Now  you recreate the mailbox in Exchange on-prem PowerShell, run the following commands:

A) Set-ADServerSettings -ViewEntireForest $True

B) Enable-RemoteMailbox “example.user@domain.com” -RemoteRoutingAddress “example.user@domain.onmicrosoft.com” -PrimarySMTPAddress “example.user@domain.com”

C) Set-RemoteMailbox “example.user@domain.com” -EmailAddressPolicyEnabled $True

D) Enable-RemoteMailbox “example.user@domain.com” -Archive

4. Go back to your AAD Sync server and run a AD Sync cycle.

5. Reapply the exchange license you removed earlier and wait for the new mailbox to create, you should notice that the errors disappear                by this point however you aren’t done yet!

6. Connect to Exchange Online Management Shell using a Global Admin or Exchange Online Administrator account. Now run the                         following command.

Get-Mailbox -softdeletedmailbox -identity example.user | *exchangeguid*

7. Now you have the the guid of the disconnected mailbox you will need the one of the new mailbox, to get this simply input the                               following:

Get-Mailbox example.user | fl *exchangeguid*

8. Now you have both the guid’s you are ready to restore the mailbox using a mailbox restore request, to do this use the following                            command:

New-MailboxRestoreRequest -sourcemailbox <guid of the disconnected mailbox> -targetmailbox <guid of new mailbox> -AllowLegacydnMissmatch

9. Now simply wait for the mailbox to restore and job done!

If you are still having issues however we do have one more method you can try by clicking here.