Exchange 2010 – Restore mailbox
So, sometimes my HR-department makes mistakes and, mistakenly, lay of a person in our HR-management-system. This in turn, makes the AD-user-object, files and mailbox disappear magically via our daily cleanup-powershell-script.
HR corrected the mistake, and it’s now up to me to restore the mailbox, among other things.
Here’s how I do it:
We used:
- Exchange 2010 SP1 Rollup Update 6
- System Center Data Protection Manager 2010
- Create a recover database on the mailbox server, that has my DPM agent installed
New-MailboxDatabase -Recovery -Server MBX001 -Name RDB
New-MailboxDatabase -Recovery -Server MBX001 -Name RDB -EdbFilePath “M:\RDB\rdb.edb” -LogFolderPath “M:\RDB” - Make sure it is mounted, either via EMC og EMS – Your choice – It might not mount before AD has completed it’s replication.
- Also make sure it is set, so “This database can be overwritten by a restore” (Right-click -> Properties -> Maintenance in EMC)
- In the DPM console – Find the mailbox that you want to recover, right-click it and press recover.
- Note, that if the user has been deleted – the mailbox might lie in another database than a possible current one – provided that your system automatically creates a new mailbox for the user, as mine does!
- If the user haven’t been deleted, but you just need to restore some items from it – Make a note to ask your user from WHEN he/she/it wants it restored from!
- Follow the guide in DPM:
– Recover mailbox to an Exchange server database
– Specify the Exchange-server where you created the RDB, and the name of the RDB 🙂 - Press Next -> Next -> Next, until it starts recovering the data into the RDB
- After it’s finished, you now have a mailbox lying around in the recovery database. What you need to do now is merge the recovered database, with the new one.
- Find the Global Unique Identifier (guid) and DisplayName of the mailbox you want to copy items from by running this in EMS:
Get-MailboxStatistics -Database RDB | Select-Object DisplayName,MailboxGuid | Sort-Object DisplayName - Now create a request for the merging – Either by GUID or by DisplayName:
New-MailboxRestoreRequest -SourceDatabase RDB -TargetMailbox mads -SourceStoreMailbox c4847352-3a53-4f42-b531-d10a25171b03 -AllowLegacyDNMismatch
New-MailboxRestoreRequest -SourceDatabase RDB -TargetMailbox mads -SourceStoreMailbox “Mads Dam” - Mails should now pour into the target mailbox even while the user is actively using it 🙂
Inspired by:
Creating a Recovery Database:
http://technet.microsoft.com/en-us/library/ee332321.aspx
Restore Data Using a Recovery Database:
http://technet.microsoft.com/en-us/library/ee332351.aspx