Exchange Exporting Mailboxes to PST Files

KB ID 0001360

Problem

Applicable To: This procedure works on all versions of Exchange Newer than Exchange 2010 SP1 (update rollup 8). If your Exchange server is OLDER than that you will need to use the following link;

Exchange 2007 / 2010 (Pre SP1)- Export Mailbox’s to PST files

The following procedure exports a user mailbox to a PST file on a network share.

Solution

Note: Not Even ‘Exchange Organisation Administrators” have the right to import / export mailboxes, you need to grant those rights to your user object, (or a better approach would be to create an admin account just for this purpose, then delete it when you are finished).

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User {username}

Grant Mailbox Export Import Rights

Note: This grants import, and export rights.

Create a file share on a drive with plenty of space, ensure the Exchange Trusted Subsystem has read / write access. And ensure the SYSTEM account has full control.

Mailbox Export Import FolderRights

To create the ‘Export Request’

New-MailboxExportRequest -Mailbox “mailbox-alias” -FilePath \\server-name\share\file-name.pst

Exchange Export to PST

Note: Add “-IsArchive” to the end of the command for Archive Mailboxes.
Note2: If the export repeatedly fails, add -BadItemLimit 200 to the end and try again, you can also use the -AcceptLargeDataLoss in exceptional circumstances

To view progress;

Get-MailboxExportRequest OR Get-MailboxExportRequest | Get-MailboxExportRequestStatistics

 

Exchange Export to PST check progress

When complete, you need to remove the move request(s);

Get-MailboxExportRequest | Remove-MailboxExportRequest OR (If you still have movement requests running) Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest

Exchange Export to PST Remove Request

Using Content Filters

You can specify a content filter to only export emails after a certain date all mail received after 01/01/17 e.g.

New-MailboxExportRequest -Mailbox {mailbox-alias} -ContentFilter {(Received -lt ’01/01/2017’)} -FilePath \\{server-name}\{folder}\{file-name}.pst

Or to export emails between two dates;

New-MailboxExportRequest -ContentFilter {(Received -lt ’31/12/2018‘) -and (Received -gt ’31/12/2017′)} -Mailbox {mailbox-alias} -FilePath {server-name}\{folder}\{file-name}.pst

Exchange Export to PST Date Range

Using IncludeFolders (and Exclude Folders)

You can specify IncludeFolders (or ExcludeFolders) to only export emails from certain folders, e.g.

Only export Inbox (and sub-folders) and Sent Items;

New-MailboxExportRequest -IncludeFolders “#Inbox#/*”,”#SentItems#” -Mailbox {mailbox-alias} -FilePath \\{server-name}\{folder}\{file-name}.pst

Don’t Export Sent Items and Deleted Items;

New-MailboxExportRequest -ExcludeFolders “#SentItems#”,”#DeletedItems#” -Mailbox {mailbox-alias} -FilePath \\{server-name}\{folder}\{file-name}.pst

Export ALL Mailboxes to  PST

foreach ($Mailbox in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $Mailbox -FilePath “\\{server-name}\{folder-name}\$($Mailbox.Alias).pst” }

Related Articles, References, Credits, or External Links

Exchange 2000 / 2003 – Exporting Mail to .pst files with ExMerge

Exchange (2010 Post SP1 and Newer) Bulk Importing Mail From PST Files

Author: PeteLong

Share This Post On

6 Comments

  1. Command to export pst to a different partition (E:)

    Post a Reply
    • Put the UNC Share on E: then use the same command 🙂

      P

      Post a Reply
      • Hi.

        How to export the mailbox to PST using alphabet. Example. Users with “A”, Users with “B”., C, D, E …

        This for to run the script step for step

        Regards

        Post a Reply
        • I’ve never done it, but why not simply do something like Get-Mailbox -Filter ‘DisplayName -like “a*”‘ and Pipe that into the Export request?

          Post a Reply
  2. Pete,

    I’m always relieved when I see a google hit on one of your posts.

    Techs like you are a dying breed. Thank you for the work you do.

    -Steve

    Post a Reply
    • Thanks Steve – Yep I’m an old dinosaur!

      Post a Reply

Leave a Reply to PeteLong Cancel reply

Your email address will not be published. Required fields are marked *