Import PST to Exchange Online with PowerShell

Thiago Costa de Oliveira 1 Reputation point

Hi all!!

I'm trying import a PST file to Office 365 using the cmdlet New-MailboxImportRequest.

The complete command is:

New-MailboxImportRequest -Name "pilotps" -IsArchive -Mailbox user@keyman .com -AzureBlobStorageAccountUri "" -AzureSharedAccessSignatureToken "[SAS KEY]" -TargetRootFolder "/" -BadItemLimit 20 -LargeItemLimit 20

I already imported the file to Azure Blob Storage (default storage created by compliance center).

When I use GUI (wizard though browser) works fine but with powershell cmdlet New-MailboxImportRequest I get the error:

Unable to open PST file ''. Error details: The remote server returned an error: (404) Not Found.

In this official doc the cmdlet can be used to Exchange Online (although there are not a single example):

I read on this blog:

That use the cmdlet is not supported in default Azure Storage (created by compliance center) and to work with PowerShell I need create my own Blob Storage but I would not want this:

The mention of blog:

"While Microsoft provides Azure Blob Storage with the PST Import Service, it appears that the SAS token that they provide only allows read and list access to the folder. You can upload PSTs to the folder using the token but you cannot download or read them. In order to use PowerShell for our imports, we’ll need to provision our own Azure Blob Storage with a SAS token that can read the uploaded files."

Someone know about this limitation? There is some official documentation?

Thanks in advance!!

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,493 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,261 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,405 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,923 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sumarigo-MSFT 44,096 Reputation points Microsoft Employee

    @Thiago Costa de Oliveira Welcome to Microsoft Q&A Forum, Thank you for posting your query!

    If you need to access the URL of azure blob storage container, You need to change the access level and provide access to the appropriate file. Please refer to this thread and let us know the status

    Generate SAS URL for the file you will be able to access the file.


    Refer to this article How to grant access Authorize requests to Azure Storage in different ways

    I would recommended to post your question in Office 365 Community Forum, These forum community members could provide their expert guidance on your scenario based on their experience related to Office 365 Thanks.

    Please let us know if you have any further queries. I’m happy to assist you further.


    Please do not forget to 185997-screenshot-2021-12-10-121802.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

  2. Thiago Costa de Oliveira 1 Reputation point

    Hi @Sumarigo-MSFT !

    Thanks for the reply! Unfortunately this is not an option because I needed some command line for make a script to automate the PST Import to M365.

    I suspect I need to change/issue a new SAS for this default Blob Storage that M365 create (but the question is: Can I make this? Where? How? hehe)

    Thanks again!

    0 comments No comments