How to Export Exchange Mailbox to PST using PowerShell Commands?
![](http://mfidie.com/wp-content/uploads/2020/09/how-to-send-confidential-email.jpg)
You may need to export Exchange Server mailboxes to PST files due to various reasons, such as taking a secure backup of the mailboxes, archiving mailboxes to local files, migrating to Microsoft 365 or other platforms, etc. You can export Exchange mailboxes to PST using the native Exchange tools, such as Exchange Admin Center (EAC) or PowerShell cmdlets in the Exchange Management Shell (EMS). In this article, we’ll be explaining the process of exporting the Exchange mailboxes to PST using the PowerShell commands.
Process to Export Exchange Mailbox to PST using PowerShell
You need to use the PowerShell cmdlet New-MailboxExportRequest to export mailboxes to PST. However, before that, you need to ensure that the user you’re using has the necessary permissions, such as the Import/Export role. Also, set up a file share to save the PST.
Assign the Right Permissions
The necessary permissions include the Import/Export role for the user. This can be set via Exchange Admin Center (EAC) or PowerShell.
Follow the below steps to set the Import/Export permissions via EAC:
- Open the Exchange Admin Center (EAC) and click on Permissions. Then, click Admin roles.
- Click on the + option to create a new role.
- Assign the Import/Export role to the user that will be used to export mailboxes.
Alternatively, you can use the following PowerShell cmdlets in theExchange Management Shell to assign the permissions:
New-ManagementRoleAssignment –Role “Mailbox Import Export” –User “<Username>”
New-ManagementRoleAssignment -Role “Mailbox Import Export” -SecurityGroup “Organization Management” -Name “Import Export”
File Share Setup
For the New-MailboxExportRequest cmdlet to work, you need to use the UNC path. So, it is necessary to use a specific network path to export a mailbox successfully. You need to create a folder and provide the necessary permissions. Here’s how:
- Once the folder is created, right-click on the folder and click the Share With option.
- Click Search User and search for Exchange Trusted Subsystem.
- Set the user permissions as Read/Write.
Export the Mailboxes
After fulfilling the above prerequisites, you can now proceed to export the mailboxes from Exchange Server to PST.
Open the Exchange Management Shell and use the New-MailboxExportRequest cmdlet.
Export the PST file to the share using the below command:
New-MailboxExportRequest -mailbox user1 -filepath “\\Server\PST_Export\UserExport1.pst”
The above command will initiate the export process.
You can check the export status by using the Get-MailboxExportRequest PowerShell cmdlet. It will display the progress status as Completed, Failed, or In-progress.
You can also include or exclude a folder using the -IncludeFolders or -ExcludeFolders parameter in the command. You can also include or exclude multiple folders using commas (see below).
New-MailboxExportRequest -Mailbox ‘user-a ‘ -Filepath “\\Exchange\PST_Export\User-a.pst ” -IncludeFolders “#Inbox# “, “#Outbox# “
New-MailboxExportRequest -Mailbox ‘user-a ‘ -Filepath “\\Exchange\PST_Export\User-a.pst ” -ExcludeFolders “#Spam# “, “#Outbox# “
In addition, you can also filter the data using the -ContentFilter parameter. The lt (less than) and gt (greater than) switches can help you export the emails filtered by date. For example, the below command can be used to export all mails older than February 21, 2022.
New-MailboxExportRequest -ContentFilter {(Received -lt ’21/02/2022′)} -Mailbox user-a ‘ -Filepath “\\Exchange\PST_Export\user-a.pst”
You can also export a date range using the combination of lt and gt switches, along with the folder parameters (see the below example).
New-MailboxExportRequest -ContentFilter {(Received -gt ’01/01/2020′) -and (Received -lt ’01/07/2020′)} -IncludeFolders “#Inbox#” -Mailbox “td1” -FilePath “\\localhost\c$\PSTFiles\td1_3.pst”
Alternative Method to Export Exchange Mailboxes to PST
Exporting Exchange mailboxes to PST using PowerShell is a complex and time-consuming process, and requires technical skills to do the job successfully. In addition, the above method does not provide advanced filter options. The above method only works when the database is healthy and mounted. It will not work if you need to export the mailboxes from a failed Exchange server or damaged/corrupted database.
As an alternative, you can use an advanced EDB to PST converter tool that can speed up the whole process significantly. Stellar Converter for EDB tool is one such tool that can export data from any version of the Exchange Server database, including 2019, 2016, 2013, 2010, 2007, 2003, 2000, and 5.5. It can export the Exchange data to PST and other formats. The best part is that it does not require any in-depth technical expertise to do the job. You just need to select the EDB file and export the selective data to PST or directly to a live Exchange Server database and Microsoft 365 account.
Conclusion
You can use PowerShell cmdlets to export Exchange mailboxes to PST in Exchange Server 2019, 2016, 2013, and 2010. However, you need to use scripting to export multiple mailboxes at a time. This can hinder the Exchange server’s performance. To eliminate all these hassles, you can use the Stellar Converter for EDB tool. The tool can help you export Exchange mailboxes to PST, with high precision and integrity.