Office 365 supports the upload of PST files to Azure storage for a direct import to mailboxes hosted in Exchange Online. The steps are described in detail in the online documentation at Microsoft Docs.
Import CSV using an email address
Workload,FilePath,Name,Mailbox,IsArchive,TargetRootFolder,SPFileContainer,SPManifestContainer,SPSiteUrl Exchange,,SALES.pst,TeamMailbox-Sales@varunagroup.de,FALSE,IMPORT,,,
But you might encounter the following error after starting the import job using the Security & Compliance dashboard.
X-Psws-ErrorCode: 840001 X-Psws-Exception: Microsoft.Exchange.Configuration.Tasks.ManagementObjectAmbiguousException,The operation couldn't be performed because 'TeamMailbox-Sales@varunagroup.de' matches multiple entries. X-Psws-Warning: When an item can't be read from the source database or it can't be written to the destination database, it will be considered corrupted. By specifying a non-zero BadItemLimit, you are requesting Exchange not copy such items to the destination mailbox. At move completion, these corrupted items will not be available at the destination mailbox. X-Content-Type-Options: nosniff
Before you were able to start the import job the job configuration, the CSV file, and the content of the PST file were analyzed successfully. There was no hint of multiple entries for the target mailbox.
The detailed error message can be retrieved using the View log link. A clear text message is stated in the Status detail column, but you need to expand the width of the column.
The hint provided in the status detail column states that there are multiple identities for the primary email. At this point in time, I do not know, how this possible when the target account is synchronized with AAD Connect.
Use the target mailbox GUID instead of the target email address as the target address in the CSV configuration file.
Connect to Exchange Online Remote PowerShell session and query the mailbox GUID for the target mailbox(es).
# Query target mailbox GUID for a single mailbox Get-Mailbox TeamMailbox-Sales@varunagroup.de] | FL Guid
Create a new import job referencing the same PST file already copied to the Azure storage.
Import CSV example using the mailbox GUID
Workload,FilePath,Name,Mailbox,IsArchive,TargetRootFolder,SPFileContainer,SPManifestContainer,SPSiteUrl Exchange,,SALES.pst,e7b7c35f-929d-420e-99a5-3c9afc419281,FALSE,IMPORT,,,
The import job will now be executed as expected.
Do you need assistance with your Exchange Server platform? You have questions about your Exchange Server organization and implementing a hybrid configuration with Office 365? You are interested in what Exchange Server 2019 has to offer for your company?
Contact me at thomas@mcsmemail.de Follow at https://twitter.com/stensitzki
This script imports multiple PST files located in a single directory into a user mailbox or a user mailbox archive.
Due to some filename limitations of the New-MailboxImportRequest cmdlet in reagards to the UNC path, the PST filenames are sanitized. Any unsupported (unwanted) character is removed. You can modify the replacement function as needed. This might be necessary as the PST filenames can be used as target folder names during import.
Original filenames:
Renamed filenames:
When using the FilenameAsTargetFolder switch each PST file is imported into a separate target folder.
After successfully importing a PST file, the PST can optionally be renamed to .imported. This simplifies a re-run of the script in the case that you a lot of PST files for a user or a large number of files as part of archive solution offboarding process.
NOTE: This script utilizes the GlobalFunctions PowerShell module for logging. Please prepare your system for the use of the GlobalFunctions module first.
Steps performed:
Example PowerShell Output
.\Start-MailboxImport.ps1 -Identity JohnDoe -Archive -FilePath "\\ROBERTKWEISS\e$\PSTImport\JohnDoe" -FilenameAsTargetFolder -BadItemLimit 10 -ContinueOnError -SecondsToWait 90 Note: Script will wait 90s between each status check! Create New-MailboxImportRequest for user: JohnDoe and file: \\ROBERTKWEISS\e$\PSTImport\JohnDoe\Myoldarchive.pst into the archive. Targetfolder:"Myoldarchive". Waiting for import JohnDoe-Myoldarchive.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive.pst to be completed. Status: InProgress Waiting for import JohnDoe-Myoldarchive.pst to be completed. Status: InProgress Waiting for import JohnDoe-Myoldarchive.pst to be completed. Status: InProgress Import request JohnDoe-Myoldarchive.pst completed successfully. Import request JohnDoe-Myoldarchive.pst deleted. Create New-MailboxImportRequest for user: JohnDoe and file: \\ROBERTKWEISS\e$\PSTImport\JohnDoe\Myoldarchive1.pst into the archive. Targetfolder:"Myoldarchive1". Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: Queued Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: InProgress Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: InProgress Waiting for import JohnDoe-Myoldarchive1.pst to be completed. Status: InProgress Import request JohnDoe-Myoldarchive1.pst completed successfully. Import request JohnDoe-Myoldarchive1.pst deleted. Script finished.
This Powershell script has been optimized using the ISESteroids™ add-on. Learn more about ISESteroids™ here.