Export mailboxes from Exchange 2007 with Export-Mailbox

When you try to use the Export-Mailbox command in Exchange 2007 for the first time, it is very likely that you will face a couple of errors. Although I can describe all the errors you have probably seen, it’s better to start all over with the basic needs:

To use the Export-Mailbox command, make sure that the following statements are true:

  1. You’re logged on to a 32bit machine (not 64bit like Exchange 2007!)
  2. You’ve installed Outlook 2003 SP2 (or later)
  3. You’re logged on with the account that should run the Export-Mailbox command in the future
  4. You have prepared a folder where the PST’s should be exported to

First, we need to add a user with the appropriate  permissions to the Exchange 2007 database, so we can access all the mailboxes.
To do this, open Exchange Management Shell (EMS) and use the following command:

Add-ADPermission EXCHSRV1\Database1 -User accountname -AccessRights GenericAll

EXCHSRV1: Exchange 2007 server where the databases are maintained.
Database1: Name of the database you want to set permissions on.
Accountname: The name of the account you want to grant permissions to run Export-Mailbox
If you’re unsure about the server and database name, type Get-MailboxDatabase in the shell. This command returns all servers and the databases.

When you have run the command, you should get an export simular to this:
Name                 Server          StorageGroup         Recovery
—-                 ——        ————     ——–
Database1         EXCHSRV1    Storagegroup1        False

 Now that the user account has been granted the appropriate permissions, we can try to run the Export-Mailbox account:

Get-Mailbox -Database EXCHSRV1\Database1 | Export-Mailbox -PSTFolderPath PSTpath

EXCHSRV1: Exchange 2007 server where the databases are maintained.
Database1: Name of the database where you want to export the mailboxes from.
PSTPath: Folder location where you want to store the PST-files. This folder must already exist.

The command will ask you for every mailbox on the database whether or not you want to export the mailbox.
Although you can use Exmerge to export the mailboxes (for the people who luke GUI :) ), you still have to add permissions to the database.


When you try to export a mailbox to a PST-file, while you don’t have sufficient permissions, the following error will occur:
Export-Mailbox : Error was found for Exch1 (Exch1@domainname.com) because: Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error: MAPI or an unspecified service provider.
ID no: 00000000-0000-00000000, error code: -1056749164
At line:1 char:65
+ Get-Mailbox -Database ExCHSRV1\Database_1 | Export-Mailbox  <<<< -PSTFolderPath C:\PST

The above error will always occur as long as you haven’t added an account to your database with the appropriate permissions. By default, an Export-Mailbox command will lead to this error.
Although you can use Exmerge to export the mailboxes, you still have to add permissions to the database.


You are running on a 64-bit computer. To export to or import from a .pst file, you must be running a 32-bit computer that has Outlook 2003 SP2 or later installed.
At line:1 char:1

You can only run Export-Mailbox on a 32bit machine with Outlook 2003 SP2 (or later) installed. If you really want to run the Export on your Exchange server, you should think of using Exmerge.

8 thoughts on “Export mailboxes from Exchange 2007 with Export-Mailbox

  1. Export-Mailbox Cmdlet is undoubtedly a great tool to export the user mailbox into .pst file. However, this utility does not provide a way to exclude the items of dumpster while exporting the mailboxes. In this case a third party edb to pst converter tool can help you that provides a option of selective items recovery. You can select the desired items before exporting them into .pst file format.

  2. I used to come with the problem,and i have solved it with a popular recovery tool called and I heard about good application named Kernel for Exchange Server

  3. great article, worked a treat.

    Note to add – if you get a pst file exported (say you’re just doing one for e.g.) that’s 265kb in size but is empty then it’s because you’ve not given yourself rights to everyone’s mailbox’s as above in the article.
    Even if you add yourself to the exchange administrator group in AD i found that didn’t help, i had to add the admin account i was using through the management shell using the adpermission script above in article.

  4. Johnny,

    I did some testing and they do seem to append rather than overwrite, delete, or complain about the existing file. This seems to be a good way to do a nightly backup to restore messages accidently deleted, or something similar. The full database backup is great for disaster recovery, but not individual mailboxes or messages…

  5. using the export-mailbox is good but not great because i can not find a parameter to append to my exported mailbox, i do not need to repeat the same command and overwrite every day about 100 GB of Mailboxes. So can you help me please to append to mailboxes. thanks

Leave a Reply

Your email address will not be published.