Quantcast
Channel: Terence Luk
Viewing all articles
Browse latest Browse all 836

Importing PSTs into Microsoft Exchange Server 2013 with PowerShell

$
0
0

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:

New-MailboxImportRequest
http://technet.microsoft.com/en-us/library/ff607310(v=exchg.150).aspx

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:

Recipients Permissions
http://technet.microsoft.com/en-us/library/dd638132(v=exchg.150).aspx

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.

image

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:

image

Once the PST import has successfully completed, you should see an output similar to the following:

image

To clear the completed mailbox imports, you can use the following cmdlet:

Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest

image

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

image

What I’ve found in the past is that the 2 reasons why imports would fail are:

  1. Bad Items
  2. 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:

-AcceptLargeDataLoss

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


Viewing all articles
Browse latest Browse all 836

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>