Export and Import mailboxes in Exchange 2010 SP1
Ever since Exchange 5.5 I have been longing for an easy way to import/export mailboxes to and from PST. I have to admit that Exmerge was a pretty decent tool back then, however, although it did work, I was very disappointed by the requirements of import-mailbox export-mailbox on Exchange 2007, and I prefer to forget the frustration of using these commands with Exchange 2010 RTM.
I can happily say that all my problems are now quickly forgotten after the release of Exchange 2010 SP1 and the new commands New-MailboxImportRequest and New-MailboxExportRequest.
Prerequisites and permissions considerations
I am happy to say that installing Outlook on the server is no longer a requirement to export/import mailboxes and this, for me, was great news!
If you rush things and directly try to run New-MailboxImportRequest cmdlet it will fail with the following error, this is because, by default, no one is assigned the permission to Import and Export mailboxes.
“The term 'New-MailboxImportRequest' is not recognized as the name of a cmdlet”

For this reason we will start by creating a security group called “Mailbox Support” and assign to it the needed permissions to import – export mailboxes.
N.B.: Note that “Mailbox Support” should be a universal security group for this to work

To enable this group to Export-Import mailboxes we need to assign it “Mailbox Import Export” role by running the following cmdlet from Exchange Management Shell (EMS). This powershell command should be familiar for anyone who already tried to import-export mailboxes on Exchange 2010 RTM, in that case there is no need to run it again.
New-ManagementRoleAssignment -Name "Import Export Mailbox Admins" -SecurityGroup "Mailbox Support" -Role "Mailbox Import Export"

You should also note that
- The Import/Export operation can only happen to/from network shares using UNC Paths it cannot be done on local drives
- The “Exchange Trusted Subsystem” group should be granted read/write permission to the this shared location
Exporting the mailbox to PST
We are now ready to export our first mailbox to a PST file, we can do this by running
New-MailboxExportRequest -Mailbox jdoe -FilePath \\172.19.0.75\c$\jdoe.pst
You can append the –IsArchive parameter to export a user’s archive

You can check on the status of the export by using the Get-MailboxExportRequest cmdlet, this command will just show the status Queued, InProgress, Suspended, Completed.

More details can be obtained by running the Get-MailboxExportRequestStatistics cmdlet

Now, with time, the Get-MailboxExportRequests will start returning a lot of entries, these can be cleared by using the Remove-MailboxExportRequest

The table below summarizes all cmdlets available for the Mailbox Export Request
| Cmdlet | Description |
| New-MailboxExportRequest | Start an export operation from a mailbox to a PST |
| Get-MailboxExportRequest | View mailbox export details |
| Set-MailboxExportRequest | Change the options of an export request |
| Suspend-MailboxExportRequest | Suspend an export request |
| Resume-MailboxExportRequest | Resume a suspended export request |
| Remove-MailboxExportRequest | Remove an export request |
| Get-MailboxExportRequestStatistics | View a more detailed set of export stats |
Importing from PST
Now that we have gone over the export process I will cover the import process. In short, the procedure is rather similar to the export one but using MailboxImportRequest cmdlets.
Of course all the prerequisites and permissions covered previously still apply here, so if you are just looking for the import process make sure to read the “Prerequisites and permissions considerations” section above.
Assuming we need to import a PST file called JDoe.pst to John Doe’s mailbox the cmdlet will look as follows
New-MailboxImportRequest -Mailbox jdoe -FilePath \\172.19.0.75\c$\jdoe.pst
Just like when exporting, adding the –IsArchive parameter will import the PST directly to the online archive of this user as show in the figure below

Another parameter worth noting is the –TargetRootFolder that will import the PST in a separate hierarchy instead of directly in the user’s mailbox/archive. Below is the result of running the following command
New-MailboxImportRequest -Mailbox jdoe -FilePath \\172.19.0.75\c$\jdoe.pst -TargetRootFolder Recovery

To get the status of the Mailbox Import Request the Get-MailboxImportRequest cmdlet is used. This will return the status of the request if it is Completed, Queued, InProgress or Suspended.
More details about the request can be returned, like the percentage of the progress, using the Get-MailboxImportRequestStatistics cmdlet
Once you have done importing orphaned Mailbox Import Requests can be removed by running the Remove-MailboxImportRequest cmdlet

One last thing I’d like to share with you today is a small batch import script. This script will simply import all PST files in a corresponding shared location to their corresponding mailbox provided that the PST filename is the same as the mailbox alias of the user it corresponds to
Foreach ($file in dir \\172.19.0.75\psts\*.pst) {New-MailboxImportRequest –Mailbox $file.BaseName –FilePath $file.FullName}
The table below summarizes all cmdlets available for the Mailbox Import Request
| Cmdlet | Description |
| New-MailboxImportRequest | Start an import operation from a PST to a mailbox |
| Get-MailboxImportRequest | View mailbox import details |
| Set-MailboxImportRequest | Change the options of an import request |
| Suspend-MailboxImportRequest | Suspend an import request |
| Resume-MailboxImportRequest | Resume a suspended import request |
| Remove-MailboxImportRequest | Remove an import request |
| Get-MailboxImportRequestStatistics | View a more detailed set of import stats |
Conclusion
MailboxImportRequest and MailboxExportRequest are, for me, two key features in Exchange 2010 SP1. I have already used them to migrate a few hundred users’ archives from PSTs to their Online Archive mailbox and planning to migrate quite a few more in the next few months.
The purpose of this article was to share with you what I have learned about these commands till today, and hope it will save you time and effort when you will need them.
Enjoyed the post, what is next?
Grab our FULL RSS feed! or Email Updates then share it
-
Guest
-
Lordmelch
-
Cmbtrok
-
Cmbtrok
-
http://whygoogle.me/ akhater
-
Ivo
-
Sro
-
bp





