This blogpost is more a note to self. I’ve blogged about this years ago, but this blog seems to be gone, although I found some remnants on msexchange.org 🙂
But, sometimes it can be useful to export Mailboxes to PST files, for example when an employee leaves the company, his account and Mailbox is removed, but you want to archive the contents of the Mailbox.
By default, no user can export or import Mailboxes to or from PST files, so these permissions need to be assigned first. As part of the Role Based Access Control (RBAC) in Exchange 2016 there’s the Mailbox Import Export role, but this role isn’t assigned to any user or Security Group.
To assign this role to a user, you can use the New-ManagementRoleAssignment command:
New-ManagementRoleAssignment –Role "Mailbox Import Export" –User "Administrator"
Beware that you have to logon again to the Exchange server to activate this change. After logging on again, you can go to PowerShell and execute the following command to export the content of a user named John:
New-MailboxExportRequest -Mailbox John -FilePath \\FS01\PSTFiles\john.pst
The export request will be queued, and the MRS (Mailbox Replication Service) will pick up the request and start exporting the Mailbox to a PST file. You can use the Get-MailboxExportRequest and the Get-MailboxExportRequestStatistics to get more information regarding the actual export:
After some time, your PST file is completed and ready for archiving.
Note. These commands are similar in Exchange 2013 and Exchange 2010.