With Exchange Server 2010 the option to use exmerge is history. Too bad because it was such a usefull tool to really quick make an export of an users mailbox. But no fear with SP1 and SP2 you can do this from the powershell command line, you’ll have to set some requirements but you’ll be exporting mailboxes before you know it.
- Microsoft.Exchange.Management.PowerShell.E2010 Snapin
- Mailbox Import Export Role
- Networkshare for PST files
Check and/or add Exchange 2010 Snapin
1. First check if the Exchange Server 2010 Snapin is installed in your Managemet Shell.
2. If it’s not on the list you can check if the required Snapin is registered. It should be listed now.
Get-PSSnapin - registered
3. To install the required Snapin execute:
The import export cmdlets are now available for use.
Mailbox Import Export Role
The Mailbox Export Import Role is not set, so no accounts are granted the rights to export mailboxes by default. You will need to explicity grant these rights, so also to the Administrator account.
Run the following command to create a new RoleGroupName with the correct Role, member(s) and a nice description.
New-RoleGroup -Name "Exchange Mailbox Import Export" -Roles "Mailbox Import Export" -Members "<domain>\administrator" -DisplayName "Exchange Mailbox Import Export" -Description "This group handles permissions to the import and export commands in Powershell."
Now you’re account will be granted access to the Exchange Mailbox Import Export command.
Networkshare for PST files
The last requirement is to create a network share to save your .pst files. The reason you want this on a network share is because the mailbox export request is processed by the CAS Server, when you have multiple CAS Servers it should be accessible by all servers.
The only requirement is that the Exchange Trusted Subsystem group has read/write permissions.
Export Mailbox commands
At this point everything is set to make a succesfull Export of your mailboxes.
Export a Mailbox
New-MailboxExportRequest -Mailbox "Administrator" -FilePath \\Server\PST$\administrator.pst
Export an Archive Mailbox
New-MailBoxExportRequest -Mailbox "Administrator" -FilePath \\Server\PST$\Administrator_archive.pst -IsArchive
Export Request Status
Get-MailboxExportRequest | Get-MailboxExportRequestStatistics
After the Export is completed it remains on the server until it is removed using the Remove-MailboxExportRequest command.
Get a list of completed Mailbox Exports
Get-MailboxExportRequest -Status Completed
Clear the list of completed Mailbox Exports
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
Interactive Mailbox export
If you would like to make this pst-export more interactive the one-liner can be changed to a small powershell script. The script ask you for the username and exports it to a username.pst file.
$user = read-host "Please enter the Username:" $share = "\\Server\Networkshare" New-MailBoxExportRequest -Mailbox "$user" -FilePath $share\$user.pst
It’s also possible to export all mailboxes to .pst files, you can read that in my blogpost: Exchange Server 2010 export all mailboxes with powershell