Recovering a deleted mailbox in Microsoft Office 365

Written by Andy on January 7 2014

I recently had an issue where a mailbox had been deleted and the mail items hadn’t been backed up. Ok, no problem. Just restore this from the Recycle Bin using PowerShell. Well that’s what I thought, however it wasn’t there! Either it had gone past its 30 retention or someone had purged it manually via PowerShell.

After trying a few things on the client machine where the mailbox resided, all of which failed, I gave up and put this down as unrecoverable. I thought I’d raise it with Microsoft anyway to see if there was anything they could do (you never know, right?). A few hours later and they came back to me with a few PowerShell commands that worked!

How To Recover A Deleted Mailbox

First of all you need to find the GUID of the mailbox that has been deleted. To do this….

  • Get-RemovedMailbox

This will return a complete list of deleted users. It will look something like this…

Recover a deleted mailbox

You may see quite a few users in here, and it starts to look a bit messy. So you know, one user account starts from the ‘RunspaceID’ and ends at ‘ObjectState’. Once you’ve found your user, copy the GUID and run the following command…

New-Mailbox -Name "" -RemovedMailbox 288be5a5-c150-4191-8cc6-9dfd2602a9c3 –MicrosoftOnlineServicesID -Password (ConvertTo-SecureString -String 'passw0rd' -AsPlainText -Force)

This will create a new mailbox with the name of ‘RecoveredMailbox’ and restore all items from the deleted mailbox, which is also named ‘RecoveredMailbox’. Give your new mailbox the same name as the mailbox that was deleted. So if you’ve deleted a user named John Smith, then name the new mailbox John Smith. Simple!