Exchange 2007 Sp1 included a feature that allows mailboxes to be exported to .PST files. This is handy because users can natively open and interact with a PST file in Outlook.

We recently had a need to export 40 mailboxes to PST file and here is what it takes:

What you need

  • 32-Bit Exchange 2007 (SP1) admin tools.
  • Outlook 2007 or higher
  • Permission on the mailboxes
  • Additional storage to compensate for PST bloat (explained below)
  • Some powershell knowledge
  • Time (explained below)

Once you stand up a virtual machine running Outlook and have installed the 32-bit Exchange 2007 (SP1) tools, then you can proceed to the next step of granting yourself permission to the mailboxes that you need to export.

Add-MailboxPermission -Identity userYouWanttoExport -User YourAdminAccount -Accessright Fullaccess -InheritanceType all -Confirm

Then, before running the export command, it is advisable to calculate the size of the PST files that would be generated to insure that you have adequate disk space to accommodate. I found that the resulting PST file is 8.25 percent larger than the mailbox size. So if you have 40 mailboxes, multiply the total size by 8.25% to get the additional size beyond the total mailbox size needed to hold all of the data.

So for example, to get the size of a mailbox you can type:

Get-MailboxStatistics –id ‘John Doe’ | ft displayname, totalitemsize

DisplayName                             TotalItemSize
———–                             ————-
John Doe                          1584624412B

The size is in bytes, this would be a 1.5 GB mailbox. After adding the 8.25% for PST bloat, the resulting exported mailbox for John Doe would be 1.7GB.

Now you’re ready to run the export command by typing the following at an Exchange Management shell prompt:

export-mailbox –id ‘John Doe’ -PSTFolderPath z:John.Doe.pst

To run this on multiple mailboxes, you can create a text file with a .ps1 extension and add the –confirm:$false command to the end of each line. This will allow the commands to execute in sequence without prompting for conformation. For example, scriptname.ps1 would contain multiple lines like this:

export-mailbox -id usera -PSTFolderPath z:usera.pst -Confirm:$false
export-mailbox -id userb -PSTFolderPath z:userb.pst -Confirm:$false
export-mailbox -id userc -PSTFolderPath z:userc.pst -Confirm:$false
{etc}

You can then run the script by simply typing scriptname.ps1 at an Exchange Management shell  prompt.

The time it takes to export a mailbox to pst is dependent upon the size of the mailbox being exported, and the speed of the systems and disk subsystem.

In our case, the export ran at an average rate of 72 megabytes per second (your experience may be different).