Export mailboxes from Exchange 2007 with Export-Mailbox
Written by Christian on June 14, 2008 – 12:27 pmWhen 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:
- You’re logged on to a 32bit machine (not 64bit like Exchange 2007!)
- You’ve installed Outlook 2003 SP2 (or later)
- You’re logged on with the account that should run the Export-Mailbox command in the future
- 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.
Error1:
—
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.
Error2:
—
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.
People who read this article, also read:
- Howto: list all mailbox databases in Exchange 2007
- Convert Legacy Mailbox to User Mailbox in Exchange 2007
- Duplicate mailbox was found, error code -1056749241
Posted in Exchange 2007 |
August 18th, 2008 at 8:23 am
This issue will be fixed in Exchange Server 2007 SP1 RU4 on Sep 2008. Please waiting a moment…