Restore Dumpster Items from Exchange 2013 Backup

Restoring mail from the ‘Recover Deleted Items’ section aka the dumpster from an Exchange 2013 Backup database.

All of the following commands were run through the Exchange Management Shell. This is easiest done if the database & log folder have been restored (we used Backup Exec 2014) to a local drive on the Exchange Database Server.


Navigate to the root directory of the restore:

cd I:\Exchange

Check the state of the database file, you’ll need to scroll back up a little to check the result. It is most likely ‘State: Dirty Shutdown’

eseutil /mh '.\Mailbox Database.edb'

The database needs to be cleaned before it can be mounted, you can replay the logs against the database with the following command.
Check the Logfolder to view the log number, the file name will be like ‘E00.log’ or ‘E01.log’ etc. Insert that into the next command with the /r switch.

eseutil /r "E00" /l "I:\Exchange\LogFolder\" /d "I:\Exchange\Mailbox Database.edb"

For me, unfortunately the log files were corrupt and/or missing (thanks BE2014!), so I had to force repair the database.
Only run this if the previous repair command would not work, it has a chance to drop data from the database you are recovering.

eseutil /p '.\Mailbox Database.edb'

Once either the clean or the force repair has completed, once again check the state of the database, it should read ‘Clean Shutdown’.

eseutil /mh '.\Mailbox Database.edb'

Now we need to create the Recovery Database using our freshly cleaned Exchange Database (.edb) file.

New-MailboxDatabase -Server ExchangeDBServer -Name RecoveryDB -Recovery -EdbFilePath "I:\Exchange\Mailbox Database.edb -LogFolderPath "I:\Exchange\LogFolder\"

As we are only using this database temporarily, there is no need to restart the Microsoft Information Store service.
We can now mount the recovered database.

Mount-Database RecoveryDB

Check the database has mounted succesfully and contains items.

Get-MailboxStatistics -Database RecoveryDB | ft -auto

Awesome! We have successfully mounted our recovery database, now we need to search for the GUID of the mailbox we want to restore items from.

Get-MailboxStatistics -Database RecoveryDB | Where { $_.DisplayName -like "DisplayNameHere*" } | Format-List LegacyDN, DisplayName, MailboxGUID

Once you have the Mailbox GUID of the mailbox you want to restore from, we can run the following command.
-SourceStoreMailbox: The GUID of the mailbox we are restoring
-TargetMailbox: We cannot export directly to pst from a Recovery Database, so this TargetMailbox is an account in your live Exchange. For paranoia I created a test account in our live database to restore mail to
-TargetRootFolder: Creates a folder under the root (Same level as Inbox) level of the TargetsMailbox
-AllowLegacyDNMismatch: Because we aren’t restoring the SourceMailbox to the same persons LiveMailbox, we need this switch to allow us to restore to an alternate mailbox

New-MailboxRestoreRequest -SourceDatabase RecoveryDB -SourceStoreMailbox "fb32b60a-0643-4102-838f-7480f2467d4b" -TargetMailbox -TargetRootFolder SourceMailbox -AllowLegacyDNMismatch

That’s it! We can check the progress of the restore with:


Once this is marked completed, you can check the TargetMailbox and look for the TargetRootFolder you specified.

The dumpster items will be contained under ‘TargetRootFolder\Recoverable Items

Once you are finished restoring files, clear the Mailbox Restore Requests and then dismount the database.

Get-MailboxRestoreRequest | Remove-MailboxRestoreRequest
Remove-MailboxDatabase -Identity RecoveryDB

Total Views: (343)

Leave a Reply

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

Connect with Facebook