Restoring an Exchange Online deleted mailbox to a different users account in a subfolder

This comes into play when an employee leaves an organization. The mailbox is deleted in O365, but the manager wants a copy of their mailbox as a subfolder in their own mailbox before the soft deleted mailbox is gone for good. Here is what to do:

Connect to Exchange Online:

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

Get the GUID of the deleted mailbox

Get-Mailbox -SoftDeletedMailbox | select name,guid

Issue the restore command

New-MailboxRestoreRequest -SourceMailbox GUIDFROMABOVE -TargetMailbox -TargetRootFolder "NAMEOFFOLDERTORESTORETO" -AllowLegacyDNMismatch

Once the restore has began, you should see a sub folder with the name you chose in the inbox of the target account. To monitor the restore progress, use this

Get-MailboxRestoreRequest | fl

Leave a Reply

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