Time has come to try import data from a PST file to an Exchange 2010 SP1 mailbox using the New-MailboxImportRequest cmdlet. As mentioned already we can do this from any machine with the Exchange 2010 Management tools installed or a machine with just Windows PowerShell 2.0 (see sidebar in the end of this article for details).
Ok let’s suppose I want to import a PST file called hew.pst located in a file share called “PSTFiles” (yes unlike Import-Mailbox you now point at a file share and not a local path) on a server named “EX02” to my Exchange 2010 SP1 mailbox. To initiate a new mailbox import request where all data in this PST file is imported into my mailbox, I would use the following command:
New-MailboxImportRequest -Mailbox HEW -FilePath \\EX02\PSTFileShare\HEW.pst
Figure 1: Importing data from a PST file to a mailbox
This will simply take all folders and data in each and import it into the specified mailbox. Also note that things such as the dumpster will be imported (if the content in the PST file originates from another Exchange 2010 SP1 mailbox that is).
If we want to get additional details about the mailbox import request, we can use the Get-MailboxImportRequest or Get-MailboxImportRequestStatistics cmdlet. As you probably would have guessed, the latter provides more details on the import than the Get-MailboxImportRequest cmdlet does.
Since you can create multiple import requests for the same mailbox simultaneously (see Figure 2), you need to specify the import request name, when you use the Get-MailboxImportRequest* cmdlets. To get a list of existing import requests, you can use this command:
Get-MailboxImportRequest
Figure 2: Mailbox Import Requests
f I want to get additional information for the mailbox import request called “MailboxImport2” using the Get-MailboxImportRequestcmdlet, I would need to use the following command:
Get-MailboxImportRequest HEW\MailboxImport2 | fl
Figure 3: Listing additional details for a mailbox import request
Or if using the Get-MailboxImportRequestStatistics cmdlet:
Figure 4: Listing mailbox import request statistics
When we have imported the data from the PST file, we need to manually remove the import request using the Remove-MailboxImportRequest cmdlet. We could also use this cmdlet to remove partially completed import requests, if you for some reason want to cancel the request.
Figure 5: Removing a mailbox import request