Exchange: Importing Mail From PST Files (including Bulk Importing)

KB ID 0000443

Problem

If you have mail in .PSF file format that you would like to import, either exported via ExMerge from an older Exchange server, or Exported via Outlook, or even exported via PowerShell, then the process for importing that mail into Exchange has been the same since Exchange 2010 (SP1).

Before SP1 you would have to install a copy of Outlook on the Exchange server and use a PowerShell command that looks like this (once you had granted Import/Export rights);

BEFORE Exchange 2010 SP1

Get-Mailbox | Import-Mailbox –PSTFolderPath C:Folder_Containing_PST_Files

 

However try that after SP1 and you will get an error message, saying that Import-Mailbox is not a commandlet. That’s because now you no longer use this command you use “New-MailboxImportRequest”, and you also no longer need Outlook installing on the server.

How To Import PST Files

Note: To Bulk Import (See Below)

Firstly make sure the folder you are importing from is shared and the ‘Exchange Trusted Subsystem’ has read permissions, and SYSTEM has full control.

PST-Import-Folder-Permissions

Grant the user you you want to Import the PST file with the appropriate permissions;

New-ManagementRoleAssignment –Role “Mailbox Import Export” –User {username}

Add-Import-Export-Roles-Exchange-2016

Note: This grants import and export rights, if you want to grant these permissions to a ‘group’ then see instructions below.

To submit the import request;

New-MailboxImportRequest-FilePath \\{server-name}\{folder-name}\{filename}.pst -Mailbox “{mailbox-user}”

Import-PST-Into-Exchange-2016

To check progress;

Get-MailboxImportRequest OR Get-MailboxImportRequest | Get-MailboxImportRequestStatistics

Import-PST-Into-Exchange-2016-View-Progress

If Mailbox Importing Fails

To troubleshoot failures, try using the following command and analysing the output;

Get-MailboxImportRequest | Get-MailboxImportRequestStatistics -IncludeReport | fl

i.e. below you can see the problem was;

“This mailbox exceeded the maximum number of large items that were specified for this request. (Fatal error TooManyLargeItemsPermanentException has occurred.)”

PST-Import-FailedOther

To fix that error you can use the ‘-LargeItemLimit 200 -AcceptLargeDataLoss’ flags (which sounds alarming, but I have not seen it break anything in the last ten years).

PST-Import-LargeItemLimit

Importing PST Files From the Exchange Admin Center

You can import PST files directly in the management GUI > Recipients > Mailboxes > Select the target mailbox > {Ellipses} > Import PST.

Import-PST-Into-Mailbox

Enter the path to the .PST file > Next.

Exchange-2016-Import-PST

Select the target mailbox > Next.

Exchange-2016-Import-PST-Target-Mailbox

Optional: Select a user to be emailed an export report.

Email-Import-Report-PST

Note: To view progress and troubleshoot failures, you will have to revert to PowerShell.

How To BULK Import .PST Files

Note: To BULK Import successfully, the .PST file MUST have the same name as the alias of the target mailbox.

Commands Required

Universal Secirity Group

1. Once you have created a “Universal Security Group” in this example called “Mailbox_Import” then assign the mailbox import/export roles with the following command;

New-ManagementRoleAssignment –Name “MailboxImportExport” –SecurityGroup “Mailbox_Import” –Role “Mailbox Import Export”

Note: If you create a ‘global security group’ you will see an error when you try to import.

2. Remember to log off and back on as the user in question before proceeding.

3. To Start the bulk import use the following command, (all you should need to change is the UNC path to the folder with the .pst files in);

Dir DC2APST_To_Import*.pst | %{ New-MailboxImportRequest -Name BulkPSTImport -BatchName Recovered -Mailbox $_.BaseName -FilePath $_.FullName}

Import PST to Exchange 2013

4. Check on progress with the following four commands;

Get-MailboxImportRequest -Status Completed
Get-MailboxImportRequest -Status Queued
Get-MailboxImportRequest -Status InProgress
Get-MailboxImportRequest -Status Failed

Import PST to Exchange 2013 Completed

5. When finished, flush the requests with;

Get-MailboxImportRequest -Status Completed | Remove-MailboxImportRequest
Get-MailboxImportRequest -Status Failed | Remove-MailboxImportRequest

Import PST to Exchange 2013 Completed

Note: Enter “A” To accept multiple removes at once.

If New-MailboxImportRequest Fails

Import PST to Exchange 2013 Failed

Firstly you need to find out why it failed, to do that you need to generate an error log.

Get-MailboxImportRequest | Get-MailboxImportRequestStatistics -IncludeReport | fl >errorlog.txt

Import PST to Exchange 2013 Failiure Log

Then open that log file, to see what it says.

Common Errors

FailureType : TooManyBadItemsPermanentException Message : Error: This mailbox exceeded the maximum number of corrupted items that were specified for this move request.

Import PST to Exchange 2013 Failiure Log

This happens when it sees items in the mailbox it does not like, or considers corrupt. To get round this problem, import the .pst file on its own with the following command;

New-MailboxImportRequest -Mailbox joe.soap -FilePath “DC2APST_TO_IMPORTjoe.soap.PST” -BadItemLimit 200 -AcceptLargeDataLoss

AcceptLargeDataLoss

FailureType : MapiExceptionShutoffQuotaExceeded Message : Error: MapiExceptionShutoffQuotaExceeded: Unable to save changes. (hr=0x80004005, ec=12 45)

MapiExceptionShutoffQuotaExceeded

This happens if you have a limit on the mailbox size, and to import from this PST file would break that restriction.

Exchange 2010 Mailbox Limits

FailureType : MailboxReplicationPermanentException Message : Error: serverfolderfilename.pst –> Page map offset {number} is greater than buffer length {number}.

Page map offset is greater than buffer length

This happens because you exported a PST file either using ExMerge or an older version of Outlook and it’s too big. Make sure it’s well under 2GB.

Additionally

If you want to import the “Old” mail into a folder within the target users mailbox, you can use the following command instead of the one in step 3;

Dir DC2APST_To_Import*.pst | %{ New-MailboxImportRequest -Name RecoveredPST -BatchName Recovered -Mailbox $_.BaseName -FilePath $_.FullName -TargetRootFolder Imported_Mail}

Related Articles, References, Credits, or External Links

Exchange Exporting Mailboxes to PST Files

Exchange 2000/2003 Exporting mailbox’s with ExMerge

Exchange 2007 – Export Mailbox’s to PST files

Author: Migrated

Share This Post On