Improvements in Exchange 2010 Import Mailbox SP1
If you have worked with Exchange versions earlier than Exchange 2007, you probably long for the days of the ExMerge utility. That handy tool from the early resource kit days was a great way to import mail into Exchange, whether that was from mailbox to mailbox, or mailbox to PST. You might even remember the “fun” that was introduced in Exchange 2007 with the new PowerShell cmdlet Import-Mailbox, which sounded great when you read the name, but quickly proved to be a big step backwards in both functionality and usability, particularly since you needed a 32 bit client to work with the 64 bit Exchange server using Exchange commands! The improvements to this command in the RTM version of Exchange 2010 helped, but it still depended upon installing a licensed copy of Outlook to do everything you might have need. Fortunately Exchange 2010 Service Pack 1 deprecates the Import-Mailbox command in favor of the new cmdlet named New-MailboxImportRequest. This cmdlet is much more powerful than its predecessors, and can actually perform the work you need, enabling you to do things like import a mailbox into Exchange 2010 and import a PST into Exchange 2010. Using the built-in MAPI provider in Exchange 2010 also means you no longer need Outlook installed to manipulate mail data.
Before you jump right into the Exchange Management Shell, be aware that by default, no one actually has the permissions required to use New-MailboxImportRequest. As an Exchange administrator, you can assign the right to the appropriate security group using RBAC. The EMS command you will use looks something like this.
New-ManagementRoleAssignment -Name “Import Export Mailboxes” -SecurityGroup “MailboxAdmins” -Role “Mailbox Import Export”
Notice that this includes the rights to both export and import mailbox in Exchange 2010; we’ll cover the export parts in an upcoming article.
There are several supporting cmdlets in Exchange 2010 that are related to the New-MailboxImportRequest command. Here’s a table with links to more information about each on TechNet:
| Cmdlet in Exchange 2010 | Description | Topic |
| New-MailboxImportRequest | Start the process of importing a .pst file to a mailbox or personal archive. You can create more than one import request per mailbox. Each request must have a unique name. | Create a Mailbox Import Request |
| Set-MailboxImportRequest | Change import request options after the request is created or recover from a failed request. | Configure Mailbox Import Request Properties |
| Suspend-MailboxImportRequest | Suspend an import request any time after the request is created but before the request reaches the status of Completed. | Suspend a Mailbox Import Request |
| Resume-MailboxImportRequest | Resume an import request that’s suspended or failed. | Resume a Mailbox Import Request |
| Remove-MailboxImportRequest | Remove fully or partially completed import requests. Completed import requests aren’t automatically cleared. You must use this cmdlet to remove them. | Remove a Mailbox Import Request |
| Get-MailboxImportRequest | View general information about an import request. | View Mailbox Import Request Properties |
| Get-MailboxImportRequestStatistics | View detailed information about an import request. | View Mailbox Import Request Properties |
So what are some of the things you can do with New-MailboxImportRequest?
A common task, now that we have so much more space available in Exchange 2010, is to import mail data from a PST into a mailbox. Place the PST file on a network share* (or use the C$ share on the user’s workstation), make sure that the “Exchange Trusted Subsystem” group has RW permissions to the share, and enter a command like this:
New-MailboxImportRequest –mailbox joeuser –filepath \\server\share\joe.pst [enter]
You can enter up to ten commands like this in a script or ps1 file to run multiple concurrent imports, or specify a name using the -name switch for each command to run more than ten. Keep that count in mind – you will see why this is important in a moment.
The command as it appears above will import all the items from the PST into the root folder of the mailbox; not the best location for email that is probably very old, and especially bad if the PST has as many messages in it as you know it will. Use the –TargetRootFolder switch to specify the folder you want the imported messages to land in. If the folder does not already exist, the import process will create it.
New-MailboxImportRequest –mailbox joeuser –filepath \\server\share\joe.pst -TargetRootFolder “ImportedFromPST” [enter]
You might not want to import all of the messages from the PST, and that is okay. Use the –IncludeFolders switch to specify a folder within the PST. You can name a specific folder or specify well known folders using #name# syntax to get around language localizations. Well-known folders include the following types:
Inbox
Sent Items
Deleted Items
Calendar
Contacts
Drafts
Journal
Tasks
Notes
Junk Email
Communication History
Voicemail
Fax
Conflicts
Sync Issues
Local Failures
Server Failures
Here’s an example:
New-MailboxImportRequest –mailbox joeuser –filepath \\server\share\joe.pst -IncludeFolders #Inbox#[enter]
Of course, the point of having a PST is usually because it is an archive, so moving old mail from a PST back into your inbox (or folder in your mailbox) seems kind of silly. Use the –IsArchive switch to import data from the PST directly into the Exchange archive, like this:
New-MailboxImportRequest –mailbox joeuser -IsArchive –filepath \\server\share\joe.pst [enter]
To see the status of running imports, use this command:
Get-MailboxImportRequest [enter]
This will list all import requests and show a status of either InProgress or Completed.
To see details on a specific request pipe the output into the format-list command, like this:
Get-MailboxImportRequest RequestName | fl [enter]
Or to see more detailed statistics, including item counts, transfer rates, etc., use:
Get-MailboxImportRequestStatistics RequestName | fl [enter]
The New-MailboxImportRequest ten count is per PowerShell session. If you close the EMS and then reopen it, the count is reset, but as long as you are in the same session, automatically named sessions remain up to the tenth, and then you can go no further until you either:
a) Remove the completed ImportRequests, or
b) Start naming them with the –Name switch.
To remove completed sessions, use the command:
Remove-MailboxImportRequest RequestName [enter]
With the powerful capabilities of the New-MailboxImportRequest command, you will have no trouble bringing all that critical mail hiding in PSTs back into Exchange. In an upcoming article, we’ll discuss the use of the complementary command, New-MailboxExportRequest. Until then, good hunting!
*Here’s an important safety tip. Accessing PST files stored on a network share from Outlook is not only explicitly not supported by Microsoft, it is a phenomenally bad idea. The only reason to move PST files to a server share is so you can get to them for import, which is why you may want to yank them from the administrative share (C$) of the user’s workstation. When a client tries to access a PST over the network, the strain it places on the file server is significant and the risk of PST corruption is high.


