Friday, November 27, 2015

Export Exchange Mailbox to PST Using PowerShell

An Exchange mailbox is used to store information like contacts, emails, calendar, events etc. This information stored on the server, can be retrieved & updated with the help of email clients. There are times when there is a need to migrate this data so that it can be accessed offline. Also in case of corruption issue in the Exchange mailbox due to virus attack or hardware failure, the user may migrate to a different platform.

Rapid Solution: Exchange Export is mainly designed to export Exchange mailbox to PST within few clicks. It overcome the limitation of PowerShell as the tool convert corrupted mailboxes to PST. Besides, it export all data items includes emails, contacts calendars, tasks etc.

Converting Exchange mailbox to PST file is one of the option in order to access mailbox data in Outlook. This can be done using two ways viz. Exchange management console/Control Panel & PowerShell.

Here, we will discuss the PowerShell method to export mailbox to PST file.

Export single Exchange Mailbox to PST file

Single or multiple mailbox can be exported from Exchange Server into PST file by following different set of commands in the PowerShell. Exporting mailbox contents to a PST file is achieved using the MailboxExportRequest cmdlet, which is a set of command in PowerShell.

Method to Convert single Exchange Mailbox to PST

1. Open the PowerShell window from Start menu.
2. Create a shared folder over the network and store the PST file (in which the Exchange mailbox data has to be exported) in the shared folder.
3. The next step is to run add–PSSnappin, which is necessary for the export command to work by adding library files. Enter the following command:
Add-PSSnapin Microsoft.Exchange.PowerShell.e2010
4. Now the next step is to run MailboxExportRequest cmdlet. 
It has 2 obligatory parameters: –FilePath – defines the network share path of the PST file to which you want to export the data and –Mailbox – defines the alias SMTP address or display name of the mailbox you will export.
5. Now enter the MailboxExportRequest command using below syntax

New-MailboxExportRequest -Mailbox <user> -FilePath \\<server FQDN>\<shared folder name>\<PST name>.pst

6. After running this command, the mailbox is exported into PST file, which is saved in the directory the user has entered in the file path.

Additional Parameters For Exporting Exchange Mailbox

There are also some parameters, which limit the amount of exported contents.

Content Filter

Specifies what conditions the contents of a mailbox have to match to be exported into the PST file. Example of a script that exports items received prior to 2015-01-01 with subjects beginning with fwd:
New-MailboxExportRequest -Mailbox <user> -ContentFilter {(Received -lt '01/01/2015') -and (Subject -like 'fwd*')} -FilePath \\<server FQDN>\<shared folder name>\<PST name>.pst

 Exclude folders and include folders

The user can also export selective folders from Exchange mailbox. There are also two interesting features available:
  • The capability to filter personal folders located under root folders using the <FolderName>/* syntax.
  • The capability to filter custom Exchange mailbox folders regardless of their name in a local language using the #<FolderName>#/* syntax.

New-MailboxExportRequest -IncludeFolders "#Inbox#/*","#SentItems#" -Mailbox <user> -FilePath \\<server FQDN>\<shared folder name>\<PST name>.pst


It defines the archive as the only source of the export option.
New-MailboxExportRequest -Mailbox <user> -IsArchive -FilePath \\<server FQDN>\<shared folder name>\<PST name>.pst


It sets the name of an export request, which is Useful for tracking. By default, Exchange assigns only 10 consecutive names to export requests related to a single mailbox (starting with MailboxExport through MailboxExport9) and then stops.
 To proceed when all the 10 default export request names have been taken, users have to either flush the export requests or start assigning Name parameter.

New-MailboxExportRequest -Name <unique name> -Mailbox <user> -IsArchive -FilePath \\<server FQDN>\<shared folder name>\<PST name>.pst

Export Multiple Exchange Mailbox to PST file

At times more than one mailbox has to be exported to PST file. The procedure for this is almost same as the case with single mailbox, except few changes in the commands.
Follow the below-mentioned steps:
1. Save all the mailboxes with a variable.
$AllMailboxes = Get-Mailbox
2. Export all mailboxes to PST files with names based on mailbox aliases.

$AllMailboxes|%{$_|New-MailboxExportRequest -FilePath \\<server FQDN>\<shared folder name>\$($_.Alias).pst}
Additional parameters can be used just as in single mailbox exports.

Limitation of PowerShell

PowerShell cannot recover the corrupt EDB file or mailboxes of Exchange Server. In addition to this, the mailbox should be mounted on Exchange Server in order to migrate its data to PST successfully.


PowerShell is a good option for exporting Exchange Mailbox to PST, which can be opened in MS Outlook easily. However, it should be kept in mind that it has its own limitations.

We hope that the article will help the users to understand the methods used to export Exchange Server Mailbox to PST for single as well as multiple mailbox.
For any query or suggestions, do comment.


Post a Comment

Post a reply