Import PST to mailboxes – Exchange 2013

For this recipe you will need:

  • a pst archive file stored on a UNC accessible location
    New-ManagementRoleAssignment –Role "Mailbox Import Export" –User Administrator
  • be granted the “mailbox import export” management role

when all this is gather, the import is pretty simple.

To import the pst file into a specific mailbox do:

[PS] C:\>New-MailboxImportRequest -FilePath \\SERVER\share$someone.pst -Mailbox someone

you can also import a pst to someone else mailbox into a specific folder:

[PS] C:\>New-MailboxImportRequest -FilePath \\SERVER\share$someone.pst -Mailbox someoneelse -TargetRootFolder "ImportedMailbox from someones PST" 

Once submitted you can follow the request status with this command:

[PS] C:\>Get-MailboxImportRequest -Mailbox someone| Get-MailboxImportRequestStatistics

Name                                   StatusDetail              TargetAlias                           PercentComplete
----                                   ------------              -----------                           ---------------
MailboxImport                          CopyingMessages           someone            92

Removing any switch to the get-mailboximportrequest will show status for all requests.

Shall it fail and you need further information, you shall use the following to examin the reason and pipe it to a file for something more legible:

[PS] C:\>Get-MailboxImportRequest -Mailbox someone | Get-MailboxImportRequestStatistics -IncludeReport | select message



Error: This mailbox exceeded the maximum number of corrupt or missing items that were specified for this request.

Lastly, you can clean up the requests using this one. Feel free to filter by status as needed:

[PS] C:\>Get-MailboxImportRequest | where {$_.status -eq "Completed"} | Remove-MailboxImportRequest

#2013, #exchange, #import, #powershell, #pst