Exchange Export Mailbox to PST

Mailbox export to PST architectureStarting with Exchange 2010 SP1 export mailbox to PST is performed through a process called Mailbox Export Request in this post we will explorer the process to export mailbox to a PST file and which requirements needs to be satisfied before the process can be carried on.

Export Mailbox to PST – Grant user rights

Before it is possible to run the Mailbox Export Request there are a couple of requirements that needs to be satisfied, let’s start saying that by default no user account is assigned the required permissions to perform the mailbox export so the first step would be assigning the required permissions to the user(s) that will perform the export command is the following

# Assign the user Lethe export mailbox to PST permissions

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User Lethe

If you are assigning the permissions to the same user you’re logged on with simply restart the Exchange Management Shell session so that it will make available the necessary cmdlets as defined in the role assignment.

Export Mailbox to PST – Create the Network Share

The next step to enable Exchange to export mailbox to PST is configuring a network share that will be used to copy the exported data, probably you are wondering why we need a network share for this rather than a local path reason is that mailbox export request is processed by the CAS server so if you have multiple CAS servers in a site any of them could process the request so all of them will need access to the UNC path.

Nothing special is needed just a standard folder where the Exchange Trusted Subsystem has been granted the read/write permissions

Export mailbox to PST

Export Mailbox to PST – Mailbox Export Request

Once permissions have been granted and the shared folder configured it is possible to export mailbox to PST with the following commands:

# Export mailbox of user Foo.Bar

New-MailboxExportRequest -Mailbox -FilePath \

To check the status of the move you can use the following command:

# List all mailbox export requests


Name                                           Mailbox                                        Status
----                                           -------                                        ------
MailboxExport                         InProgress

To get more details you can pipe the command’s result to Format-List cmdlet or even better use the Get-MailboxExportRequestStatistics cmdlet like this:

# Get information about the running Mailbox export to PST

Get-MailboxExportRequest | Get-MailboxExportRequestStatistics

# Output will be similar to the following

Name                                   Status                    SourceAlias                           PercentComplete
----                                   ------                    -----------                           ---------------
MailboxExport                          InProgress                Foo.Bar                             75

Once the mailbox request is completed you you will need to remove it from the working queue to do so simply issue the command:

# Clear all completed mailbox export requests

Get-MailboxExportRequest | where {$_.status -eq "Completed"} | Remove-MailboxExportRequest

The above command will remove all mailbox export requests which have a status of completed.

Export Mailbox to PST – Automatically clear mailbox export request

Strictly speaking the process of clearing completed export requests is not a lengthy or complicated but if like me you are super busy (read super lazy) you can automate the whole process with something like the following:

# Automatically clear completed export requests

While ((Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status
-eq "Queued" -or $_.Status -eq "InProgress"})) { sleep 60 } Get-
MailboxExportRequest | Remove-MailboxExportRequest -Confirm:$false

# Script will run till there is a pending request

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s