How to Mass Export All Exchange 2010 Mailboxes to PST

I recently ran into a situation where I needed to mass export all the Exchange 2010 Mailboxes out to PST files.

Use this quick powershell code snippet to accomplish the task:

$mailboxes = get-mailbox
foreach ($mailbox in $mailboxes) {
new-mailboxexportrequest -mailbox $mailbox -FilePath \\server\c$\$mailbox.pst
}

Note that the file path must be a UNC path and not a drive letter!

To monitor the status of the exports use the following command:

Get-MailboxExportRequest | Get-MailboxExportRequestStatistics

Situations where you may need to use this:

  • Migrate mailboxes completely out of your exchange 2010 environment
  • Backup all mailboxes in their current state for legal discovery
  • Backup all mailboxes for import into a email archive application
  • Historical archive of mailbox out of exchange 2010 for legal or compliance purposes

You may need to add the “Mailbox Import Export” role to your administrator account.  If so use this command:

New-Managementroleassignment –Role “Mailbox Import Export” –User “Administrator”