Merge Office 365 mailboxes
So John is leaving the organisation, and his replacement (Fred) wants all of his emails accessible without the need to have a separate mailbox. Fred might also want John’s emails coming directly to his mailbox.
This scenario assumes that you don’t want to do an identity change (if that’s too much of a hassle).
Merge the two mailboxes with PowerShell commands!
Note that executing user must be a member of the Discovery Management Admin Role Group plus Mailbox Search.
The following command will move John’s emails to Fred’s inbox in a folder called “Johnsmail”
Search-Mailbox -Identity “email@example.com” -TargetMailbox “firstname.lastname@example.org” -TargetFolder “Johnsmail” -LogLevel Full
Note that this operation will only work for up to 10,000 items.
If you want to move the items , run this command and make sure you are a part of the “Mailbox Import Export” management role. Without the “-DeleteContent” switch, it will copy the items.
Search-Mailbox -Identity “email@example.com” -TargetMailbox “firstname.lastname@example.org” -TargetFolder “Johnsmail” -LogLevel Full -DeleteContent
If you want to check how many items are in John’s mailbox, then run the following:
search-mailbox -Identity email@example.com -EstimateResultOnly
Create the search:
New-MailboxSearch -Name “John to Fred” -SourceMailboxes firstname.lastname@example.org -TargetMailbox email@example.com -LogLevel Full
Execute the copy:
Get-MailboxSearch “John to Fred” | Start-MailboxSearch
If you need to check the status, run:
Get-MailboxSearch -Identity "John to Fred" | FL status
If you need any reference to these switches, check out: