Back in the good old days of OnPrem Exchange this could be achieved by exporting the PST from one account and re-importing it in the target account by using the New-MailboxExportRequest
and New-MailboxImportRequest
cmdlets, all nice and easy (ish). Obviously this is not an option in the cloud. Microsoft recommend sharing the old mailbox to the new one, should you need to share mail or grant access to an older mailbox, however this isn’t always the best option. So what do you do?
The answer is to soft-delete the mailbox and then use the New-MailboxRestoreRequest
to merge the accounts. If you are fully cloud you should be able to mark it as deleted in O365, if hybrid, then moving the account to an OU not synced in AADConnect and waiting for your next sync should suffice for it to register as deleted. Get yourself logged into EXO Powershell and then run the below command with your source and target mailboxes:
New-MailboxRestoreRequest -SourceMailbox NameOfYourSoftDeletedmailbox@domain -TargetMailbox -NameOfYourTargetMailbox@domain -AllowLegacyDNMismatch -LargeItemLimit 50 -BadItemlimit -50 -Name NameOfThisRestoreRequest
Once running, you can look up the status of the request by running Get-MailboxRestoreRequest
A little overview of the switches used:
-AllowLegacyDNMismatch
– required if the LegacyExchangeDN values don’t match on the mailboxes, which is probably likely if synced up from OnPrem.-LargeItemLimit
– request will fail if this is omitted and large items are encountered. Large items are those that are larger than the target mailbox will accept (either on the configured maximum message size value, or the org wide value for this if not specifically set on the mailbox). If you need to set this as a value above 50, the switch for -AcceptLargeDataLoss
will also need to be specified.-BadItemLimit
– request will fail if this is omitted and bad items are encountered. If you need to set this at a value above 50, the switch for -AcceptLargeDataLoss
will also need to be specified.-Name
– you will want to name this request to make it easier to search with Get-MailboxRestoreRequest
, otherwise it will be a nightmare to find in the output.
Sources
Reddit – thanks to HighExplosive for answering this one
Microsoft Documentation on New-MailboxRestoreRequest
Tags: Exchange, Mailbox merge
Comments are closed here.