Exchange 2010 DB Restore Part 2

In Part 1 , we have restored an Exchange database to a recovery database called RecoveryDB. Now let us extract the content of a mailbox for User named “John Smith” whose SamAccountName is “JohnS”

  1. First thing you need to get information about mailboxes in the recovery database after it is mounted

               Get-MailboxDatabase RecoveryDB |Get-MailboxStatistics

Note: All restore operations uses the mailbox DisplayName or GUID to identify mailboxes in the recovery database and not SamAccountName

2. Restore data to the live user mailbox (John Smith) under a folder named Recovery:

     New-MailboxRestoreRequest

                –SourceDatabase RecoveryDB

                            – SourceStoreMailbox “John Smith”

                                        –TargetMailbox “John Smith”

                                                         –TargetFolder RecoveryItems

Where :

  • New-MailboxRestoreRequest : is the new way for restoring items. It is a background process so, when you run the command, nothing will happen, but in the background, the exchange will start working on the request. To get information about what is happening after submitting the request, type : Get-MailboxRestoreRequest |Get-MailboxRequestStatistics 
  • SourceStoreMailbox : is the user that you want to recover his mailbox. You cannot use the user’s SamAccountName here (JohnS) for example, you only can use the user’s Display Name or GUID
  • TargetMailbox : is the user mailbox that you want to restore things to.
  • TargetFodler: is the folder that is created in the (TargetMailbox) user with all restored items. If you don’t mention this parameter, then the command will merge content from the restored items and the (TargetMailbox) items.

So, running the above command, will create a folder Named (recoveryItems) in John Smith mailbox with his recovery items after the restore command is completed. If you didnt mention the (TargetFolder) option, then John Smith will find his mailbox merged with items from the restore operation. This is useful in some scenarios where the user deleted all his mailbox items.

3. (Or) Restore data to a temp mailbox named (TestUser)

       New-MailboxRestoreRequest

             –SourceDatabase RecoveryDB

                       – SourceStoreMailbox “John Smith”

                                   –TargetMailbox “TestUser”

                                                    –AllowLegacyDNMismatch

Where :

  • AllowLegacyDNMismatch: is simply telling Exchange that we want to restore John Smith mailbox to another temp mailbox.

BIG NOTE : If you get error while restoring a certain mailbox, then you can get more information about the error by typing (Get-MailboxDatabase RecoveryDB |Get-MailboxStatistics |FL). Sometimes, using the old Exchange restore command solves the problem :

Restore-Mailbox -Identity “John Smith” -RecoveryDatabase RecoveryDB  -RecoveryMailbox “TempUser”  -TargetFolder “Recovery”

The bad news here is that this command is synchronous which means that you need to keep your eye on the PowerShell console until the command succeeded.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s