How to Export Exchange Database to PST?

Shelly Bhardwaj
6 min readApr 9, 2021

You need to export from an Exchange Server for various reasons, such as:

· Someone is leaving the company and you need to export the mailbox.

· You would be spring cleaning the mailboxes and you need to export the data before removing the mailboxes.

· You would be migrating to either Microsoft 365 or another Exchange Server. You need to export all mailboxes for safe keeping before decommissioning an Exchange Server.

By exporting to PST, you would have a copy of your mailboxes in case you need to use it to import, extract data, or open the PST file in an Outlook application. There are various methods to export Exchange database to PST.

· Using Exchange PowerShell

· Using Exchange Admin Center

· Using EDB Converter Software

Pre-Requisites to Export using PowerShell or Exchange Admin Center (EAC)

Before starting the export, you need to have some pre-requisites in place:

- Have the right permissions

- Create the share

To setup the right permissions, you can use the Exchange Admin Center (EAC). For this, open the EAC and after logon as the administrator, click on Permissions and Admin Roles (see below).

Then, click on the plus button to create a new role. Find the Import/Export role and assign the user which will be exporting the mailboxes.

Note: The Administrator, although being the global administrator, doesn’t have the permissions to export. So, you need to assign them accordingly.

You can assign the permissions by using PowerShell with the commands below:

New-ManagementRoleAssignment –Role “Mailbox Import Export” –User “<Username>”

New-ManagementRoleAssignment -Role “Mailbox Import Export” -SecurityGroup “Organization Management” -Name “Import Export”

Using Exchange Admin Center (EAC) or PowerShell, you cannot export directly to a drive/ folder, for example c:\export\mymailbox.pst. You need to specify a UNC path after a share. Once you have the folder created, you need to share the folder with the Exchange Trusted Subsystem.

1. Exporting using Exchange PowerShell

Exporting to PST via PowerShell would require some scripting skills. To use PowerShell, you need Exchange Server 2010 with Service Pack 1 and fully updated or newer Exchange version. The command is New-MailboxExportRequest.

To export a mailbox to PST, open the Exchange Management Shell and enter the below command.

New-MailboxExportRequest -mailbox user1 -filepath “\\Server\PST_Export\UserExport1.pst”

The command will start the process of exporting the mailbox to a PST file. You can see the progress of the export by using the Get-MailboxExportRequest PowerShell cmdlet (as given below).

This command will give you the information on the export and show if the export is in-progress, completed, or failed.

With the PowerShell, you can also do some filtering while exporting. You can include/exclude folders and specify dates.

Include or Exclude Folder

To include folders, add the -IncludeFolders parameter (as given below) and separate multiple folders with a comma.

New-MailboxExportRequest -Mailbox ‘user-a ‘ -Filepath “\\Exchange\PST_Export\User-a.pst “ -IncludeFolders “#Inbox# “, “#Outbox# “

To exclude folders, you need to use the -ExcludeFolders parameter.

New-MailboxExportRequest -Mailbox ‘user-a ‘ -Filepath “\\Exchange\PST_Export\User-a.pst” -ExcludeFolders “#Spam#”, “#Outbox#”

Filtering by Date

To export based on dates, you can use the -ContentFilter with the lt (Less then) and gt (Greater than) switches.

To export all emails older than January 1, 2021, use the following command:

New-MailboxExportRequest -ContentFilter {(Received -lt ‘01/01/2020’)} -Mailbox user-a ‘ -Filepath “\\Exchange\PST_Export\user-a.pst”

To export all emails newer than January 1, 2021, use the command below:

New-MailboxExportRequest -ContentFilter {(Received -gt ‘01/01/2020’)} -Mailbox vuser-a ‘ -Filepath “\\Exchange\PST_Export\user-a.pst”

You can also export based on a date range by using the combination of both lt and gt and including the folder parameters too.

New-MailboxExportRequest -ContentFilter {(Received -gt ‘01/01/2020’) -and (Received -gt ‘01/07/2020’)} -IncludeFolders “#Inbox#” -Mailbox “td1” -FilePath “\\localhost\c$\PSTFiles\td1_3.pst”

2. Exporting using the Exchange Admin Center (EAC)

To export using the Graphical User Interface (GUI), you must be running Exchange 2013 or newer. To start the export process, open and login to the Exchange Admin Center (EAC). Then, click on Recipients and right-click on the mailbox to export.

Next, click on the Export to a PST file to start the export process. In the next screen, you need to select if you would like to export the mailbox or the archive mailbox.

Next, choose the UNC path to export the PST file to.

You can also choose to send an email to a specified user when the export is complete.

3. Using Stellar Converter for EDB

You can use Stellar Converter for EDB to export Exchange mailboxes to PST. By using Stellar EDB Converter, you can open any EDB file of any Exchange version — from Exchange 2007 to Exchange 2019, without having the Exchange installed. You do not need to have the mailbox database mounted to be able to export. You can export all the mailboxes or select various mailboxes from EDB files. You can export to PST and other formats or export directly to a live Exchange Server mailbox database or an Office 365 tenant. The application drastically reduces the amount of time and effort to export mailboxes.

Conclusion

Using the PowerShell, you can only export one mailbox at a time. To export selected mailboxes, you need to either create a long script or do a script to loop to export all mailboxes in a database and export accordingly. You need to be careful on the number of mailboxes to export as this will hinder the performance of the server. Also, you can only export from one database at a time. Another thing to note is that the database must be online to be able to export from it by using PowerShell and EAC. To avoid such hassles, you can use Stellar EDB Converter to export from your Exchange Server and databases

--

--

Shelly Bhardwaj

I am a Product Consultant and is associated with Stellar Data Recovery from last 8 years. I write about Exchange Server, Office 365, Outlook, and other topics.