Exchange 2010 Export to PST

you can find many articles about exporting to PST, but i have simple check list for you :

  • You should have rights to do that   (New-ManagementRoleAssignment –Role “Mailbox Import Export” –User Administrator)
  • You cannot export from recovery database directly to PST
  • So you need to restore to a temp mailbox first (TempUser)
  • Run this command to restore items from mailbox user named (TempUser) to PST

            New-MailboxExportRequest -Mailbox “TempYser” -FilePath \\…….\items.pst

Note : in the above command , you need to specify a file share where the Exchange Trusted Subsystem has access to write to.

Keep in mind :

  • Since CAS servers will be doing the export, you need to specify a UNC path for the FilePath parameter
  • To get information about the export request : ( Get-MailboxExportRequestStatistics) or (Get-MailboxExportRequest |FL)
  • To export the archive mailbox to PST , just add the IsArchive switch at the end of the command (New-MailboxExportRequest -Mailbox “TempYser” -FilePath \\…….\items.pst -IsArchive)
  • Get Info about completed requests , to get list of completed exports : Get-MailboxExportRequest |Where {$_.status -eq “completed”} .
  • Cleanup is good. Purge completed requests by : Get-MailboxExportRequest |Where {$_.status -eq “completed”} |Remove-MailboxExportRequest

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.

Exchange 2010 DB Restore Part 1

It is one of the pain points of Exchange admins to restore mailbox. Well, i did my homework and I want to share with you how to restore Exchange mailboxes using Backup Exec (Software from Symantec) or even snapshot software:

Step 1: Creating the Recovery Exchange Database

  1. Create a Recovery DB named RecoveryDB  by running this Power Shell command:

          New-MailboxDatabase   -Recovery  -Name  RecoveryDB  -Server  ServerName  -EDBFilePath  “F:\Exchange Server\Recovery Databases\RecoveryDB\DB\RecoveryDB.edb”  -LogFolderPath  “F:\Exchange Server\Recovery Databases\RecoveryDB\LOG” 

  1. Mount the database and check (This database can be overwritten by a restore).
  2. Dismount the database before starting the restore job.

Step 2: Restore Database from Tape (Backup Exec)

Use Backup Exec to run a restore job. ServerName in the below picture represent the Exchange Mailbox Server where the recovery database is hosted (mounted)

Image

Image

or using the new Backup Exec 2012 , here is the settings:

Image

Image

Image

Image

Settings are simple and I cannot go to each setting and explain it. I am supposing that you are restoring from a full backup Exchange database and using either Backup Exec 2010 or 2012.

Backup Exec is great because it will restore the database and then go and replay all logs. In short words, after the restore, the restored database will be in a clean shutdown scenario.

Step 3: Restore Database from Snapshot

If you are restoring from Snapshot software, then the restore will bring the recory database to dirty shutdown simply because snapshot restore will not replay the logs back. You have to do it manually by :

  • Make sure your logs and DB files are in same directory.
  • Delete the  CHK file
  • To dump the database and check if the database is dirty shutdown, type (eseutil /mh dbfile.edb )
  • To replay logs and bring the database to healthy (clean shutdown), type (eseutil /R EXX /I /D), Where EXX is the log prefix

Step 4 : 

Check the next Blog Post ! 🙂