Exchange Server administrators, sometimes, need to export mailboxes from Exchange Server to PST files. Some common reasons include archiving old mailboxes, taking backup of mailbox of a leaver, and archiving an unwanted mailbox. To facilitate the export of mailboxes to PST, Exchange Server (2010 SP1 onwards) offers the New-MailboxExportRequest PowerShell command. Exporting mailboxes to PST using this PowerShell command is a better option than using the Exchange Admin Center (EAC) as it offers filtering options. You can also script a loop to export all mailboxes or a range of mailboxes at once. In this article, we will see how to use the New-MailboxExportRequest PowerShell command to export Exchange mailboxes to PST files.
Using the New-MailboxExportRequest Command to Export Mailboxes to PST
To run the New-MailboxExportRequest command, the user account must be assigned with the Mailbox Import Export role. You can use the Exchange Admin Center (EAC) to assign the required permissions. Follow the given steps:
- Open the Exchange Admin Center (EAC). After login, click on Permissions and then admin roles.
- Click the Add (+) button.
- Enter the name for the group.
- Click the Add (+) button under the Roles.
- Find Mailbox Import Export and double click on it to add it to the list. Click OK.
- Add the user to be used to export data in the Members area and click Save.
You can also assign the newly created role to the user or group by using the below command.
Now, you need to create a share where you want to export the PST files and give the right permissions on it. After creating the folder where you want to export your PST files, you need to share the folder with the user that has the Import/Export role. You also need to add the Exchange Trusted Sub System to the permissions. These users must have full permissions on the folder and on the share.
Exporting the Mailboxes to PST
After fulfilling the above prerequisites, let's see how to use the New-MailboxExportRequest command.
To export all the mailboxes to PST, you can use the following command:
This will export the mailbox, named User1, to the share PST Files on EX01 server as User1.pst. Depending on the size of the mailbox, it will take some time to finish.
You can see the progress of the export by using the Get-MailboxExportRequest cmdlet. It will show the status of export as Completed, Failed, or In-Progress.
To export a specific folder or folders from the mailbox, you can use the include folders switch in the command (see the below example).
To export more than one folder, you can separate them with a comma.
To exclude a particular folder, you can use the ExcludeFolders switch (see the below command). For excluding multiple folders, you can separate them with a comma.
By using the Content Filter parameter, you can export mailbox items to PST based on a specific date or a date range.
To export items till a particular date, you can use the command as given below:
The above command will export all the mailbox items till 1st January 2018.
To export items from a date onwards, you can use the gt switch (see the below example).
To export mailbox data for a date range, you can combine the gt and lt switches (see the below example).
You can also suspend the export request which is in-progress, by using the Suspend-MailboxExportRequest command as given below.
To get the information about the identity, you can run the Get-MailboxExportRequest command.
To clean up the completed export requests, you can use the below command.
This will clear all exports with the status completed.
If you want to remove the requests with the failed status, you can use the below command.
To Conclude
Above, we have explained how to use the New-MailboxExportRequest command to export mailboxes to PST in Exchange Server. However, it has some limitations, such as mailbox must be online (not disconnected), export must be done one-by-one, running script to export all the mailboxes hinders the performance of the server, reporting is not accurate, and export from only mounted mailbox databases.
To overcome such limitations, you can use a third-party EDB to PST converter application, such as Stellar Convertor for EDB. It is an ideal tool for any Exchange Admin as it can open any type and version of Exchange databases - from Exchange 2007 till Exchange 2019. It can export mailboxes and other data to PST and other common formats, such as EML, MSG and PDF. It can also directly export the EDB data to a live Exchange Server or Microsoft 365 tenant.