If you need to import PST files to mailboxes and you are using Exchange Online, there is a unique way of doing this action in the cloud, so lets get started.....
Get Mailbox size before Import
This is handy so you know if the import was sucessfully completed, so for that we need this command:
Get-MailboxStatistics Bear@diepiggydiedie.com | fl DisplayName,TotalItemSize
That will return this:
Right good, so its 1.578GB before in the import, nice.
Compliance is the Way!
First you need to go to compliance to get you import task SAS URL from the import wizard, so first you need this URL:
https://compliance.microsoft.com
Once here you will need "Data Lifecycle Management" then "Office 365" as below:
Then you need a name for the job, there are weird requirements for this name, you will know if its wrong.....
Requirements: Job Name: 2-64 lowercase letters, numbers or hyphens, must start with a letter, no spaces
Data Transfer Type
You then need to upload your data so select that as below:
SAS URL for PST's
Then you need the SAS URL to upload the PST files to, and you need AzCopy as well which is installed on the computer where the PST file are located and you need the mappings file.
First get the SAS URL, but clicking "Show network upload SAS URL" that will then revel the SAS URL as below, all you need here is the "copy to clipboard" button, click that and confirm you SAS URL is actually in your clipboard:
AZCopy
Then you need to start a command prompt, not as an admin this time (for a change) and nivigate to the folder where AZCopy is installed like this. you do not need the DIR, but that confirms AZCopy.exe is there.....
Then you need this command to copy data to the Azure SAS URL:
azcopy.exe copy "<Source location of PST files>" "<SAS URL>"
azcopy.exe copy "C:\PST\*" "https://sasurl.goes.here/23r3r2r32r32r3r3e1r/blah"
I like to confirm that the upload is complete with Azure Storage Explorer, first you will need to get storage explorer from here
From here is Blob Container:
Then SAS URL:
Then you need to put the SAS URL in the box below:
That will take you to the summary screen, and yes the SAS URL has been removed:
Then you click connect - find that SAS account, click on it, and the files uploaded will be to the left, the name of those files is behind that big red box:
Mapping File
This is a CSV file that contains a header field and then the data field, so that look like this, do not play with the header field and then you have the values you need for your requirements:
Exchange,\<folderpath>,<pst_file_name>,<mailbox-forimport>,FALSE,/,,,,
Example:
Exchange,,\bear.pst,bearx1@whodoytouthinkyouare.mail.onmicrosoft.com,FALSE,/,,,,
<pst_file_name> defines the name of the PST you uploaded which is case sensitive
Then you need to give your CSV file as you can see here:
Once you have clicked Upload File and navigate and selected your file you need to validate it with the "validate" button:
When you click the validate button you get this and no errors, then you are good to carry on the import process:
Caution: If you get a error here, you will get a validation failed and you will need to download a CSV file to see the error you got - like on the community chest in Monopoly.
Once that is accepted it will look like this, however remember this is the import and analysis of the file, not the import into the mailbox:
Import to Office 365
Now you get the option to filter the data before you import, this is not required for this exercise as I have said no:
When you continue you will get a review screen with the total data size, click submit to get the party started:
The job will then change to "Import in progress" and you are now importing the data:
After some waiting around for the cloud to start doing the job it was doing from the start, you will notice or if you click on the import job that data will be being sent to the destination mailbox:
With a click on that job you get this:
Confirm with the mailbox has data
This is the last bit in confirming all is going well with the import, so lets get the mailbox size before the import, which you should have done from the start of this guide, but did you forget ?
Get-MailboxStatistics Bear@diepiggydiedie.com | fl DisplayName,TotalItemSize
That will return this:
Get-MailboxStatistics Bear@diepiggydiedie.com | fl DisplayName,TotalItemSize
and that should return more data this time, as the PST has been replayed to it: