Learn Exchange the Guru way !!!


Using Exchange Management Shell to Export mailbox data in Exchange Server 2007

The export mailbox feature in Exchange 2007 replaces Exmerge, a handy tool in legacy versions of Exchange.

Things to remember:

1. Exchange Management Console, the GUI to administer exchange 2007 cannot be used to export mailbox data, we need to use the shell.

2. Public folders are not supported for export mailbox

3. Cross forest export mailbox is not possible.

Permissions required for export mailbox:

The account with which we perform the task should possess:
1. Full mailbox access – The account with which we perform the export mailbox should have full mailbox access, on a store level or on a user level.

In order to grant full access to a mailbox, use “Add-MailboxPermission” cmdlet and specify FullAccess for the AccessRights parameter.

Guru– The admin account to be granted full mailbox rights

User A– Mailbox from which data to be exported

Run these commands in Exchange Management Shell:

Add-MailboxPermission -Identity UserA -User Guru -AccessRights FullAccess
Add-MailboxPermission -Identity UserB -User Guru -AccessRights FullAccess

2. The account Guru should be granted Exchange Server Administrators level permissions and should have Local Administrator rights for the source server as well as target server

3. For legacy Exchange 2003 or Exchange 2000 mailbox, the account Guru must have the Exchange Administrator role for the administrative group in which the server resides.

To export data from a *.pst file, run the Export-Mailbox cmdlet from a 32-bit computer that has the following installed:
a. The 32-bit version of the Exchange management tools
b. Outlook 2003 Service Pack 2 (SP2) or Outlook 2007

4. Exchange 2007 management tools 32-bit download

5. The target mailbox specified must exist before you run the command, to export data to a folder in another mailbox

How to:
The “Export-Mailbox” cmdlet exports all message types, including messages, calendar items, contacts, distribution lists, journal entries, tasks, notes, and documents. By default, the “Export-Mailbox” cmdlet exports all empty folders, special folders, and subfolders to the target location.


To export data to a *.pst file- Mailbox copy.pst to a location C:\Export Mailbox, run the following command:

“Export-Mailbox -Identity -PSTFolderPath C:\Export Mailbox\Mailbox copy.pst


To export data that was received between February 2, 2005, and February 15, 2005, to a .pst file, run the following command:

Export-Mailbox -Id -StartDate “02/02/05” -EndDate “02/15/05” -PSTFolderPath C:\Export Mailbox\Mailbox copy.pst


To export only data from the Deleted Items folder, run the following command:

Export-Mailbox -Id UserA -IncludeFolders ‘\Deleted Items’ -TargetFolder ‘UserA Deleted Items’ –TargetMailbox Export Mailbox


To import a *.pst to UserA mailbox, run the following command:

Import-Mailbox -Identity -PSTFolderPath C:\Export Mailbox\Mailbox copy.pst



3 Responses to “Using Exchange Management Shell to Export mailbox data in Exchange Server 2007”

  1. Darrin Casson Says:

    I am trying to export the inbox, deleted items, and sent items but I dont want the sub folders beneath these folders. I have been using this script below but now I am being asked to remove the subfolders. Any suggestions?



    export-mailbox -IncludeFolders “\Inbox”,”\Sent Items”,”\Deleted Items” -pstfolderpath E:\Exports\georgetate.pst

  2. Pablo DeLa Cruz Says:

    How can I use the Export/Import-Mailbox command shell to delete duplicate messages in my Inbox. I’m running Exchange 2007 SP3

    Thank you

  3. CFDultra Says:,

    I am facing a problem.
    When I run the “Get-mailbox” or “Export-mailbox” cmdlets my cursor just blinks and do nothing.
    My Exchange ir running well. My users don´t ask me no problems hapenning.
    What is wrong?



Leave a Reply




Do NOT follow this link or you will be banned from the site!