Exporting multiple mailboxes to PST in Exchange 2007

Sometimes you need to export more than one mailbox. In my case one company was split in to two company’s so we needed to move the users mailboxes to the new Exchange Server.


32 Bit OS (joined to the domain) I used windows 2008 server.
Exchange Management tools 32 Bit
Outlook 2007
CSV file with the usernames
Access to the users mailbox that you are going to export.

When you have installed your server you need to create a CSV file that look like this.

To start the export start the Exchange Management Shell with administrative rights (elevated)
Modify the command below so that it fits your organization.
The –BadItemLimit is so that the export will continue with the mailbox even if there are some corrupt emails. You can change the number so that it fits your organization.

foreach ($user in (Import-CSV “E:\export.csv”)) { Export-Mailbox -BadItemLimit 5 “$($user.Username)@yourdomain.com” -PSTFolderPath “E:\PST” -Confirm:$false }

 Problems that I had before I got it to work:

Make sure that there is a folder called
C:\Program Files\Microsoft\Exchange Server\Logging\MigrationLogs if not create it and make sure that you have write access to that folder.

Make sure that this Registry value exist
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\Exchange Migration if not create it and make sure you have write access there.

This entry was posted in Scripting, Windows Server. Bookmark the permalink.

3 Responses to Exporting multiple mailboxes to PST in Exchange 2007

  1. Cults14 says:

    Excellent, our Sys Admin people didn’t seem to worry about this, were happy to open as many PS Windows as it took to export multiple mailboxes one at a time! Other sites on the web suggested using ps1 scripts but they seemed to dump all users into one PST (which was called “.pst”!!)

    As Compliance Analyst who gets lumbered with Litigation Holds which I used to execute in ExMerge, this is an absolute vboon.

    Thanks again


  2. Dhananjay Pawar says:

    Gr8 solution sir, you really hellped me out of difficult task.

  3. olive says:

    thanks for sharing such information, but i m bit late to know this technique as when i had to export multiple exchange mailboxes to pst i have to seek to 3rd party apps, that worked well for me. I wish would have know this technique earlier. In my case my Exchange mailboxes were badly corrupted so it was mandatory for me.

Leave a Reply

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