How to Export Mailboxes to PST Files

Migrate Mailboxes to PST
Last reviewed: April 2026 — checked against current Microsoft product lifecycle and Exchange Online enforcement timelines.
Last reviewed: April 2026 — checked against current Microsoft product lifecycle and Exchange Online enforcement timelines.

This is one of the more common tasks for administrators and users alike. The need to export mail outside of the mailbox can stem from simple archiving to legal subpoenas.

In this example, we’ll show how to select several mailboxes from Microsoft Exchange, export the data, and some of the reporting that is available. Super-ExMerge, in contrast to the commands available on an exchange server such as New-MailboxExportRequest, Super-ExMerge does not run on the mail server. This means that the CPU demand for this work is also separated from the server. This can be valuable for cases where there may be concern about exporting a large quantity of mailboxes quickly. A Microsoft Exchange server is not going to allow “too much” to occur at the same time since it has to share the CPU between regular mail tasks and the export process.

The first step in this task is to identify all the mailboxes that need to be exported. Super-ExMerge uses Microsoft Exchange’s AutoDiscover feature to find and validate mailboxes to which to connect.

AutoDiscover accepts SMTP addresses for lookup requests. So, in this case we’ll need a list of email addresses for the mailboxes to be exported. If using Exchange 2007 or later, collecting email addresses for mailboxes is quite trivial using Exchange PowerShell:  

 

NOTE

Super-ExMerge uses MAPI to access mail data, not EWS (Exchange Web Services). This provides better performance and the ability to use multiple threads, and also better data fidelity since data stays in a native binary format thru the entire process.

$names = @('bruce wayne', 'alfred pennyworth', 'richard greyson', 'edward nygma')
$mbxs = $names | Get-Mailbox

Now that a list of mailboxes is found, we can build a set of connection objects that define our source and target stores for the export.

if (![System.IO.Directory]::Exists('c:\pstfiles')) { [System.IO.Directory]::CreateDirectory('c:\pstfiles') }
foreach ($mbx in $mbxs){
  $conn = New-ConnectionInfo Mailbox PST $mbx.PrimarySMTPAddress 'exch01.my-domain.com' 'admin@my-domain.com:Password' "c:\pstfiles\$($mbx.PrimarySmtpAddress).pst"
  $task = New-SyncTask $conn -OneWaySyncSourceToTarget
  Add-SyncTask $task
}

In the above script, we first make sure the destination for the PST files exists, and if not create it. The sync task won’t create the folder.

Next, we enumerate all the mailboxes collected earlier, creating a new connection object for each one. Note that some shorthand was used – the New-ConnectionInfo example doesn’t have any parameter names. All the parameters of that cmdlet are positional parameters, so if you set all the data in order on the command line, PowerShell will line up your arguments to the matching parameters.

We chose to use the email address of each mailbox as the name for our PST files. A “double quote” around text allows PowerShell replace tokens in the string with values. However, because $mbx is an object, if we don’t do some extra stuff, PowerShell will simple try to replace only the $mbx token with a string, followed by .PrimarySmtpAddress. The $(expression) syntax ensures that PowerShell evaluates the expression first, then converts that result to a string.

Once we have the $conn object created, we use it to create the $task object, specifying that it will be a one-way sync, from the source mailbox to the PST. Having been added to the task queue, the task engine will start processing the tasks. One question that will immediately arise is “how to I check on this?” Checking on running tasks is easy, as follows:

Show-SyncTaskProgress
TaskID                         : 335d55d1-1fc2-4f57-bc23-71c8319fa84d
TaskName                       : Sync from [Mailbox] bruce.wayne@wayne-enterprises.com to [PST] c:\pstfiles\bruce.wayne@wayne-enterprises.com.pst
------------------------------ :
Startup Progress               : [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
Source Folder Enumeration      : [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
Target Folder Enumeration      : [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
Source Folder Analysis         : [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
Target Folder Analysis         : [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
Source Items Enumerated        : [oooooooo                                                                        ]
Target Items Enumerated        : [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
Source Item Analysis           : [oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
Target Item Analysis           : [                                                                                ]
Source Folder Content Collect  : [ooooooooooooooooooooooooooooooooooooooooooo                                     ]
Target Folder Content Collect  : [oooooooooooooooooooooooooooooooooooooooooooooooooooo                            ]
Item Processing                : [                                                                                ]
Item Completion                : [                                                                                ]
NOTE:

When Super-ExMerge is processing, the items and folders are discovered in separate threads. As such, progress is non-linear, meaning that many, if not all, of the progress bars will show increases as time proceeds. For example, the Items Completed may show 100% in one moment, but then show 20% in another because a different thread that is processing folders discovers more items.

We can see from the above that progress is being made on the export process. Given the performance-oriented nature of Super-ExMerge by the use of many independent threads, an ‘overall progress’ is not exactly easy to show. Once the enumeration and analysis progress bars show 100%, the Item Completion progress bar can be used as an overall progress indicator.  

Ready to Talk Through Your Migration?

Priasoft has been handling Exchange and Microsoft 365 migrations since 1999. Whether you're scoping a new project or recovering from a stalled one, our engineers have seen it before. No sales pitch — just a working conversation with people who have done this work at scale.

Speak With an Engineer Download a Free Trial