You want to create mailboxes in Exchange Online and use Office 365. Before you can…
Export Exchange mailbox to PST with PowerShell
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
In the article, we are going to walk through the following:
- 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. 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 are going to 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.
1 2 3 4 5 6 7 8 9 |
[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.
1 2 3 4 5 |
[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.
1 2 3 4 5 |
[PS] C:\>Get-MailboxExportRequest | Get-MailboxExportRequestStatistics Name StatusDetail SourceAlias PercentComplete ---- ------------ ----------- --------------- MailboxExport Completed amanda.morgan 100 |
If you only want to filter on completed status.
1 2 3 4 5 |
[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.
1 2 3 4 5 6 |
[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 is 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.
Conclusion
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 is finished.
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.
What do you recommend as an alternative to using the ‘.pst’ format for back up?
Thank you for this!
This helped me tremendously!