I had to import a bunch of exported PSTs into a new Microsoft Exchange Server 2013 environment as we had to migrate a new client from another hosting provider onto our platform and as I haven’t done it for awhile, I didn’t realize how many errors I ran into in the past so I figure I’d write a blog post that I can refer to in the future.
The PowerShell cmdlet used for importing mailboxes is New-MailboxImportRequest which can be found at the following TechNet article:
Prior to begin importing PSTs, you will need to assign a user with permissions to perform the action as described in the following TechNet article:
To grant the permission, use the following cmdlet to add a user to the Mailbox Import Export role:
New-ManagementRoleAssignment -Role "Mailbox Import Export" -User Administrator
**Note that I’ve assigned the Administrator account the role in the cmdlet shown above.
With the permissions set, the cmdlet used to import a PST into a mailbox of a user creating a folder named “Migrated Emails” would look like following:
New-MailboxImportRequest -Mailbox "John Smith" -FilePath \\someFileServer\E$\someFolder\john_smith.pst -TargetRootFolder "Migrated Emails"
Once the cmdlet above has been executed, you can use the Get-MailboxImportRequest cmdlet to view the status:
Once the PST import has successfully completed, you should see an output similar to the following:
To clear the completed mailbox imports, you can use the following cmdlet:
Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest
There will be times when you’ll notice that various imports mail fail and to investigate why the move has failed, you can use the following cmdlet to include a report:
Get-MailboxImportRequest -Status Failed | Get-MailboxImportRequestStatistics -IncludeReport | Format-List > AllImportReports.txt
What I’ve found in the past is that the 2 reasons why imports would fail are:
- Bad Items
- Large Items that exceed the mailbox stores’ limits
To get around the bad items, you can set a limit of bad items you are willing to skip as such:
New-MailboxImportRequest -Mailbox "Maria Smit" -FilePath \\someServer\E$\someFolder\maria.pst -TargetRootFolder "Migrated Emails" -BadItemLimit 10
Note that if you specify a bad item limit of higher than 50, you will also need to use the switch to avoid having the cmdlet fail:
To get around the large items, you can use the following switch to ignore the size of the large item limit and to import them anyways:
New-MailboxImportRequest -Mailbox "Maria Smit" -FilePath \\someServer\E$\someFolder\maria.pst -TargetRootFolder "Migrated Emails" -LargeItemLimit 10