MSExchangeGuru.com

Learn Exchange the Guru way !!!

 

Exchange 2010 Export-Mailbox cmdlets

Exchange 2003 had Exmerge. Exchange 2007 and Exchange 2010 use Export-Mailbox command to export user mailboxes to PSTs.This can be used for exporting or importing PST for a huge list of users as well.

The Export- Mailbox and Import-Mailbox can only be used by a user account that is assigned the role “Mailbox Import Export” role. In Exchange 2010, these commands are hidden by default. Also, Outlook 2010(64-bit) must be installed on the Exchange 2010 Mailbox server to do the export.

Providing Permissions:

Users who are members of the Microsoft Exchange Security Group “Organization Management” can assign the “Mailbox Import Export” role to other users.

The following power shell command can be used to assign the “Mailbox Import Export” role to an individual user:

                 New-ManagementRoleAssignment -Role “Mailbox Import Export” -User UserAlias

The following command can be used to assign the “Mailbox Import Export” role to a Security group:

                 New-ManagementRoleAssignment -Role “Mailbox Import Export” -SecurityGroup NameofGroup

In addition to the “Mailbox Import Export” role, the users who runs the Export or Import-Mailbox command should also be a member of the local Administrators group on the Exchange server.

Export mailboxes to PST files:

1. Install Outlook 2010 64-bit on the Exchange 2010 Mailbox server

2. Create a folder on the hard drive where mailboxes should be exported. For Example: C:\UserPST

3. Ensure that the necessary permissions are assigned to the user account that is performing the activity.

Cmd-lets:

Update:

Now Exchange 2010 only accepts the cmdlet:

New-MailboxExportRequest “alias” -FilePath \\Servername\E$\Folder\Filename.pst

Update: PN: 03/21/2016

For the bulk export use the following:

$Alias = Get-mailbox

$alias|%{$_|New-MailboxExportRequest -FilePath “\\Servername\PSTS\$($_.alias).pst“}

To get the Stats:

Get-MailboxExportRequest

Update: Following commands have been deprecated.

To export the mailbox of User A(Alias: User.A) to the folder that has been created C:\UserPST

                 Export-Mailbox -Identity User.A -PstFolderPath C:\UserPST

To export all the mailboxes from a mailbox database (Database1)

                 Get-Mailbox -Database “Database1” -ResultSize Unlimited | Export-Mailbox -PstFolderPath C:\UserPST 

To Export all the mailboxes from a server (ServerA)

                 Get-Mailbox -Server ServerA -ResultSize Unlimited | Export-Mailbox -PstFolderPath C:\UserPST

To Export all the mailboxes from all the Exchange servers and databases in an Exchange Organization

                 Get-Mailbox -ResultSize Unlimited | Export-Mailbox -PstFolderPath C:\UserPST 

To export all the mailboxes for users in a specific OU(ExchangeTeam) in Active Directory:

                 Get-Mailbox -OrganizationalUnit ExchangeTeam -ResultSize Unlimited | Export-Mailbox -PstFolderPath C:\UserPST

Failed Export:

The export will not work if the CAS role is installed with the mailbox role in the same server. A bug has been identified for this issue. In such situations, the Export and Import-Mailbox commands will not work. You may have to export PST from client machines. The following error appears when trying to run the Export-Mailbox command in such situations:

StatusCode : -2147221219
StatusMessage : Error occurred in the step: Approving object. An unknown error has occurred.

In such scenarios, use Outlook 2010 to export user mailboxes to a PST file. If not, installed CAS and Mailbox server on different servers.


Meera Nair
Team @ MSExchangeGuru

7 Responses to “Exchange 2010 Export-Mailbox cmdlets”

  1. Mike MacNeill Says:

    Where are the Export-Mailbox cmdlets installed? We do not have them on our servers and I can’t find downloads anywhere for them.

  2. Andor Says:

    Hi,

    Can you confirm the Export-Mailbox CMD-let will only be available from the moment you install the Outlook 64bit client on the specific Exchange server?

  3. Jenny Says:

    Great post. It can be noted that Exchange cmdlets fail to extract or import data in many cases. Sometimes the work around resolves the issue, if not, third party solutions can help. This blog post discusses the same issue: http://edbtopstconverter.stellarservertools.com/blog/limitations-of-export-mailbox-cmdlet

  4. Blue Jonesh Says:

    Good post!!
    No doubt, Export_mailbox cmdlet has made the job easy of Exchange server administrators

  5. rafael lopez Says:

    how do I do a bulk mailbox export for various users using a csv list created with all of the mailboxes that I need to export for former employees to a share.

  6. Eli A. Says:

    Hi,
    under powershell:
    how to download xlsx file (arrived daily) from exchange server 2010 mailbox to a shared folder without using outlook
    and after that deleting the message.
    sincerely
    Eli A.

  7. Prabhat Nigam Says:

    I would suggest hiring a powershell scripter for 40 hours.

Leave a Reply

Categories

Archives

MSExchangeGuru.com