There are several occasions in which an administrator would want to export Exchange 2010 mailbox to PST. The most common ones include to migrate on-premise mailboxes to Exchange online and to extract a single or a few mailboxes from the database. Though rare, another situation that demands such an export is to salvage data from a damaged or corrupted Exchange 2010 database file (EDB).

You’d have to agree that all those are pretty good reasons to support the conversion of EDB data to PST format. Now that that’s established, how about moving on to the technique to do it? Well, that’s the interesting part; we’re letting you know a neat method to use PowerShell commands and achieve the said export. But if you’re in the mood for some automation, we also have a suggestion up our sleeve that’ll surely impress you. So hang on tight and let the fun begin!

Mailbox Export Request

To export a mailbox or archive data to a PST file, first, a mailbox export request needs to be created. Each request has a unique name and for each mailbox up to 10 unique requests can be created. But, at one time, only one request can be executed since the PST file is marked as in-use when the request begins to run. Additionally, the Exchange Management Console (EMC) that is used for running cmdlets for different Exchange tasks cannot be used to create a mailbox export request. For this purpose, the Exchange Management Shell (EMS) must be used.

Microsoft Exchange Server 2010 has introduced a new set of PowerShell cmdlets to achieve this task. Another thing to note here is that though PowerShell scripts are quite powerful and helpful in exporting and importing data, they’re not supported over 64-bit machines. If EDB files are corrupted, dismounted or disconnected, an EDB to PST conversion independent of Exchange server can bulk export Exchange 2010 mailbox to PST (32-bit as well as 64-bit).

Ok but, how the hell do we do it? Let’s check the steps:

Steps to export mailbox to PST

The process to export mailbox to PST Exchange 2010 is divided into 4 broad steps.

1) Grant necessary permissions and roles

As the first step, create grant full rights to user who will be performing the export. By default no accounts have this right hence they need to be manually configured. Execute the following command in EMS:

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

In the command above, “User” is the username. If you’re already logged in with that username, just restart the EMS session and you’ll be granted access to the new cmdlets.

2) Create a Network Share that will store the exported PST files

There can be multiple CAS in a network and any of them can process the export mailbox request. Thus, you must ensure that the path of the target PST file is valid. This path has to be UNC not a local path. The ideal method is to create a new Network Shared folder and grant the grant Exchange Trusted Subsystem group read/write permission to this folder.

3) Export mailbox to PST

Now that everything is configured properly, the PowerShell cmdlets can be executed to perform Exchange 2010 export mailbox to PST.

To export user’s primary mailbox to PST:

New-MailboxExportRequest -Mailbox <username> -FilePath <pstFilePath>

In the above command, points to the folder that will store the exported PST file. This command doesn’t create a new directory so make sure the path you’re giving exists, otherwise the command will fail.

To export user’s personal archive to PST:

New-MailboxExportRequest -Mailbox <username> -IsArchive -FilePath <pstFilePath>

To export specific data from user’s mailbox to PST:

New-MailboxExportRequest -Mailbox <username> -ContentFilter {<filter>} -FilePath <pstFilePath>

In the above command, {} can be any value that filters required data from the rest. Please check Microsoft support for the correct syntax.

To export a specific mailbox folder to PST:

Specific mailbox folders include mailbox folders such as Inbox, SentItems, DeletedItems, Calendar, Contacts, Drafts, Journal, Tasks etc. In the command, the folder to be exported is denoted within opening and closing # markers. For example, to export Inbox folder, denote it as #Inbox# in the following command:

New-MailboxExportRequest -Mailbox <username> -IncludeFolders "#Inbox#" -FilePath <pstFilePath>

4) Monitoring & Cleaning up

As a last step, the export process must be cleaned up after. To check the status of all active export jobs, run the following command:

Get-MailboxExportRequest | Get-MailboxExportRequestStatistics

Once all mailbox export requests are completed, to clean up, remove all assigned permissions using the following command:

Remove-ManagementRoleAssignment "Mailbox Import Export-<username>"

Also remove the completed mailbox export request from the server with the following command:

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

Thank you to the guys over at stellar, without your handy info the above HowTo would not be possible.

Questions/Comments?

\