Ingest PST Files Into Exchange Online From A Custom Azure Storage Account

I hate when I see PST files being used as a business solution. It’s quite common when performing a discovery that you will find a host of users who heavily rely on PST files as their “Personal Archives”. This usually stems from a lack of storage space in an on premises Exchange environment, with users being asked to clean up their mailboxes when they start getting larger. Even with increases in available storage, this practice never really went away for a lot of people.

It doesn’t always make sense to end users who have neatly collected twenty years worth of PST archives on their local C drive as to why this is such a bad idea (and no, OneDrive isn’t a solution for this). Generally, as part of an Exchange Online migration, I recommend collecting and ingesting the PST files into the users online archive.

PST Ingestion Service

The Exchange Online PST Ingestion Service has been around for a long time. It’s a fantastic tool that is really easy to use and helps organizations to work towards removing PST files from use without users losing any data they may have stored in them.

The service is quite straight forward and can be kicked off from the compliance center as long as you have assigned the “mailbox Import Export” role in Exchange Online. The ingestion service will provide a free Azure Storage Blob to upload all the files to, it will also recommend using AZ Copy for network upload and walk through the syntax for the upload process. A mapping file can then be provided to import each PST into the relevant mailbox or archive. This is a great, easy way of getting the PST files ingested into Exchange Online and made available to users within a secure, redundant solution.

For very large data sets, there is also the option of shipping a drive directly to Microsoft to avoid uploading all that data over the network. There is a small cost associated with this method but it is a valid option for very large organizations.

Using Custom Storage Accounts

The service provides an excellent method of ingestion for 99% of organizations however for some more complicated organizations with more strict data governance controls in place, this may not tick all the boxes. For those use cases, there is another method that’s not quite as well known.

The ingestion service really runs the exchange cmdlet “New-MailboxImportRequest” in the background with a host of flags pointing to Azure Blob Storage so we can cut out the middle man and run this command ourselves to import from locations other than the Microsoft provided blob.

To do this, we obviously need to create a new storage account and blob container in our Microsoft Azure subscription. Once it’s created, we can use AZ Copy to upload (or any other connection to the blob such as Storage Explorer). We can even use the new built in Storage Explorer in the Azure Portal to upload our files.

Once data is uploaded, we need to generate a SAS URI for the import request to use.

Finally, we need to format our import command as below:

New-MailboxImportRequest -Name <Job Name> -Mailbox <> -AzureBlobStorageAccountUri <Blob Endpoint / Folder Name / PST Name> -AzureSharedAccessSignatureToken <SAS Token> -TargetRootFolder <Root folder for import> -BadItemLimit <Amount of bad items before import fails> -LargeItemLimit <Amount of large items before import fails>

For example, for the above PST file the command would look like:

New-MailboxImportRequest -Name "demo import" -Mailbox -AzureBlobStorageAccountUri "" -AzureSharedAccessSignatureToken "?sv=2019-12-12&ss=b&srt=sc&sp=rwdlacx&se=2020-11-16T08:36:32Z&st=2020-11-16T07:36:32Z&spr=https&sig=o4FmfojEUfsf4b1rVssometextremovedhere" -TargetRootFolder "/" -BadItemLimit 20 -LargeItemLimit 20

Note: A target root folder of “/” will import into the top level of the mailbox, merging with existing folders.

For more information on ingesting PST files, see the Microsoft Documentation on the ingestion service “Overview of importing your organization’s PST files – Microsoft 365 Compliance | Microsoft Docs

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s