We want to create a Hybrid deployment between Exchange on-premises and Exchange Online. When we…
It’s useful to export Exchange mailbox to PST. For example, an employee is leaving the organization, and you want to archive the mailbox to a PST file. By default, no user can import and export to PST file in Exchange Server. You need the role permissions before you can do that. In this article, you will learn how to export Exchange mailbox to PST with PowerShell.
Table of contents
Information exporting Exchange mailbox to PST file
Exporting an Exchange on-premises mailbox is different than exporting an Office 365 mailbox. Are you looking at how to export an Office 365 mailbox to PST file? Read the article: Export Office 365 mailbox to PST.
In the article, we will export an Exchange on-premises mailbox. The steps that we will take are:
- Check if the account has role permission
- Create a network folder for the PST export
- Export the mailbox to a PST file
- Remove role permissions
Check Mailbox Import Export role permission
The Mailbox Import Export management role enables administrators to import and export mailbox content and purge unwanted content from a mailbox. Therefore, we need to have access to the Mailbox Import Export role. If we don’t have access, we can’t export PST files from Exchange Server.
I wrote an article about it. Read more about New-MailboxExportRequest is not recognized.
After you have the role assigned, you will have permission to export PST in Exchange. See the next step of creating a network share folder.
Create a network folder for the PST export
If we export the mailbox data to PST file, it needs to be saved to a folder. We will create a folder with the correct permissions.
Create a folder named PST in your C: drive. Right-click the PST folder and click properties.
Select the tab Sharing and click Advanced Sharing…
Enable Share this folder. Click Permissions.
Add the Exchange Trusted Subsystem group with Change/Read permissions.
Add the SYSTEM account with Full Control permissions. Click OK.
Now that you have created a network share for the PST files, you can export the mailbox to PST in Exchange.
Export Exchange mailbox to PST with PowerShell
List the mailboxes if you don’t have the name of the mailbox name. It will list all the mailboxes in the organization.
[PS] C:\>Get-Mailbox Name Alias ServerName ProhibitSendQuota ---- ----- ---------- ----------------- Administrator Administrator ex01-2016 Unlimited Amanda Morgan amanda.morgan ex01-2016 Unlimited Anna Welch anna.welch ex01-2016 Unlimited Benetiz Anees Benetiz.Anees ex01-2016 Unlimited Boris Campbell boris.campbell ex01-2016 Unlimited
Did you assign permissions in the last part? Close Exchange Management Shell and rerun it for changes to take effect.
Ensure that you are using the Alias when running the next command behind the -Mailbox cmdlet to export PST.
[PS] C:\>New-MailboxExportRequest -Mailbox amanda.morgan -FilePath "\\ex01-2016\pst\amanda.morgan.pst" Name Mailbox Status ---- ------- ------ MailboxExport exoip.local/Company/Users/HR/Amanda Morgan Queued
Check the status of the export.
[PS] C:\>Get-MailboxExportRequest | Get-MailboxExportRequestStatistics Name StatusDetail SourceAlias PercentComplete ---- ------------ ----------- --------------- MailboxExport Completed amanda.morgan 100
If you only want to filter on completed status.
[PS] C:\>Get-MailboxExportRequest -Status Completed Name Mailbox Status ---- ------- ------ MailboxExport exoip.local/Company/Users/HR/Amanda Morgan Completed
The export of the mailbox to PST is 100% complete. Let’s verify by going to the network share path.
Now that you verified the export to a PST file in the folder, you can clear the completed export request statistics. Confirm with Y and press Enter.
[PS] C:\>Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest Confirm Are you sure you want to perform this action? Removing completed request 'exoip.local/Company/Users/HR/Amanda Morgan\MailboxExport'. [Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): Y
The completed export statistics are successfully cleared.
Remove role permissions
Now that you finished the PST export, it’s good to remove the assigned permissions to the role. Read the article New-MailboxExportRequest is not recognized.
In this article, you learned how to export Exchange mailbox to PST with PowerShell. The next time will be much faster now that you followed the article and did a mailbox export to PST in Exchange. That’s because we walked you through the export Exchange mailbox to PST step by step. Don’t forget to remove the assigned role permissions when the PST export finishes.
The documentation by Microsoft gives you extra information regarding mailbox exports to PST files in Exchange Server. Did you enjoy this article? You may also like Repair corrupted mailbox Exchange. Don’t forget to follow us and share this article.