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
June 20th, 2011 at 10:36 am
Where are the Export-Mailbox cmdlets installed? We do not have them on our servers and I can’t find downloads anywhere for them.
October 21st, 2011 at 3:14 am
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?
September 20th, 2012 at 4:09 am
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
October 13th, 2012 at 7:29 am
Good post!!
No doubt, Export_mailbox cmdlet has made the job easy of Exchange server administrators
August 6th, 2013 at 2:22 pm
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.
November 13th, 2014 at 3:39 am
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.
December 1st, 2014 at 10:28 pm
I would suggest hiring a powershell scripter for 40 hours.