Posted on February 10, 2015 · Posted in Exchange

How to Import and Export PST Files in Exchange 2013

In the previous Exchange versions, to import/export data from Exchange to PST files you had to use third party utilities. As the most common tool ExMerge can be named, which any experienced Exchange administrator had to use. In Exchange Server 2010 SP1 to import/export the contents of the Exchange mailbox from/to PST files, there appeared some special Powershell cmdlets: New-MailboxImportRequest and New-MailboxExportRequest.

In Exchange 2013, the developers have left these functions having extended them and improved their performance. In this article, we’ll cover typical examples of import/export data from Exchange 2013 mailboxes to personal folders files (PST).

Rights to Import and Export Data to Exchange Mailboxes

First of all, you need provide an account the rights to import and export data to an Exchange 2013 mailbox (by default, even the Exchange administrator doesn’t have these rights). You can do it in Powershell (to be more exact, in Exchange Management Shell):

New-ManagementRoleAssignment –Role “Mailbox Import Export” –User usetest

where usetest – is the name of the account that gains the rights.

Tip. To make the administration easier, the Mailbox Import Export role is usually assigned to the AD group. Later, if this right has to be given to another user, it will be enough to include account to this group. In this case, the command syntax is a bit different (suppose, the name of the AD group is ExchangeAdmGroup):

New-ManagementRoleAssignment -Role "Mailbox Import Export" -SecurityGroup ExchangeAdmGroup

The same can be dome from the graphic interface of EAC (Exchange Admin Center), having assigned Mailbox Import Export role to a certain user or a group.

"Mailbox Import Export" role in Exchange 2013

After the rights have been given, the EAC or Management Shell must be restarted.

How to Import the Contents of a PST File in Exchange 2013 Mailbox

To import a PST file to the Exchange mailbox, you need the following besides the rights:

  • The necessary Exchange mailbox must exist
  • The PST file must be located on the network resource and you have to know the complete UNC path to it (don’t forget that the local file can be addressed any time by its network path like \\PCName111\C$\PST\tstmail.pst)
  • The user performing the import operation must have access to the network folder with the PST file

Using the following command, run the import of PST file from the network resource to the user mailbox.

New-MailboxImportRequest -Mailbox usetest -FilePath \\HQ-FS01\PST\usetest.pst

In this example, the contents of the existing folders in the target mailbox is united, and new folders are added to the current mailbox folder structure.

The contents of the PST file can be imported to the existing folder of the mailbox (e. g., “Old_mail”). For example, we need to import only the contents of the Inbox to the target folder Old_mail:

New-MailboxImportRequest -Mailbox usetest -FilePath \\HQ-FS01\PST\usetest.pst  -TargetRootFolder "Old_mail" -IncludeFolders "#Inbox#"

Tip. Here is the full list of the standard folders in the Exchange mailbox:

  • Inbox
  • SentItems
  • DeletedItems
  • Calendar
  • Contacts
  • Drafts
  • Journal
  • Tasks
  • Notes
  • JunkEmail
  • CommunicationHistory
  • Voicemail
  • Fax
  • Conflicts
  • SyncIssues
  • LocalFailures
  • ServerFailures

After the import command has been run, the request is queued to be processed by the Exchange server (the processing is done on the server with Client Access Server role). To see the queue, run this command:


Get-MailboxImportRequest in Exchange  Server 2013

The task status for a certain mailbox can be obtained as follows:

Get-MailboxImportRequest mailtst

To get information on the status of import requests (in percent), run the command below:

Get-MailboxImportRequest | Get-MailboxImportRequestStatistics


The completed requests can be removed from the queue with this command:

Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest

For import multiple PST files to the user’s mailboxes, the following command can be used (it is supposed that the names of PST files correspond to the names of the user mailboxes):

Foreach ($i in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $i -FilePath "\\HQ-FS01\PST\$($i.Alias).pst" }

If a failure occurs during the import, you can get a detailed information on its reasons from the report that can be created as follows:

Get-MailboxImportRequest -Status Failed | Get-MailboxImportRequestStatistics -IncludeReport | Format-List > AllImportReports.txt

In most cases import failures take place due to:

  • damage of PST file structure
  • exceeding the limit of the mailbox

You can specify the limit of bad items of the PST files that can be skipped:

New-MailboxImportRequest -Mailbox mailtst -FilePath \\HQ-FS01\PST\usetest.pst -BadItemLimit 10

How to Export the Contents of an Exchange 2013 Mailbox to a PST File

The export of the contents of the Exchange 2013 mailbox is similar to its import.  New-MailboxExportRequest cmdlet is used for the export. To export the mailbox of mailtst user to the network directory (this directory has to be created in advance), execute the following command:

New-MailboxExportRequest –Mailbox mailtst –FilePath \\HQ-FS01\ExportPST\mailtst.pst

If you have to export to a PST file the contents of a certain folder, e.g., Inbox, the command looks like this:

New-MailboxExportRequest –Mailbox mailtst –FilePath \\HQ-FS01\ExportPST\mailtst.pst -IncludeFolders “#Inbox#”

To exclude a folder from the export, use ExcludeFolders parameter. For example, you don’t need to export deleted items:

New-MailboxExportRequest –Mailbox mailtst –FilePath \\HQ-FS01\ExportPST\mailtst.pst - ExcludeFolders “#DeletedItems#”

Let’s consider a more complex task: suppose, you have to export all letters received after January, 1, 2015, that contain keywords “MSProject” and “London”.

New-MailboxExportRequest –Mailbox mailtst –FilePath \\HQFS01\ExportPST\mailtst.pst –ContentFilter {(body –like “*MSProject*) –and {body –like “*London*) –and (Received –lt “01/01/2015)}

The export task also is queued on the Exchange server. To see the task status, run this command:

Related Articles