Batch export Exchange mailboxes to PST

I recently had a requirement to export a bunch of mailboxes to PST from an Exchange 2010 environment. Thankfully Exchange 2010 SP1 had been deployed so I had access to the New-MailboxExportRequest series of cmdlets. Here’s what I came up with:

$ou = "nwtraders.msft/Users/Left"
$mailboxServer = "LONEX01"
$destinationUNC = "\\LONFS01\MBOX$\"

$mailboxList = Get-Mailbox -OrganizationalUnit $ou -Server $mailboxServer
$mailboxList | foreach-object {
New-MailboxExportRequest -FilePath $($destinationUNC)$($_.Name).pst -Mailbox $_.Name -Name $_.Name
}


If you decide to use something like this, you’ll need to grant the Exchange Trusted Subsystem group write access to the network share you’re using to export the mailboxes to.

To view the progress of export requests in progress you can pipe the output of Get-MailboxExportRequest through Get-MailboxExportRequestStatistics , like so:

[PS] C:\>Get-MailboxExportRequest -status InProgress | Get-MailboxExportRequestStatistics

Name Status SourceAlias
---- ------ -----------
Dave Hope InProgress DaveHope
Test Account 1 InProgress TestAccount1
Test Account 2 InProgress TestAccount2
Test Account 3 InProgress TestAccount3

If none of these cmdlets work for you, you’ll need to use RBAC to create a new “Role Group” with the “Mailbox Import Export” role and assign it to your account.

Published by

Dave Hope

Dave is a Principal Software Analyst for a UK based retirement developer, in his spare time he enjoys digital photography and rock climbing.

2 thoughts on “Batch export Exchange mailboxes to PST”

  1. new-mailboxexportrequest : missing an argument for the “name”. specify a parameter of type ‘system.object’ and try again

Leave a Reply

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