- Microsoft Graph: A single (PowerShell) API for Microsoft’s cloud services - Tue, Aug 23 2022
- Exchange impersonation: Grant permissions to service accounts - Mon, Aug 8 2022
- Send Microsoft Teams meeting invitations in multiple languages - Thu, Jul 21 2022
The first steps to preparing for a .pst export in Office 365 are the same as for an on-prem Exchange. You must first create the permission for the import and export function with:
New-ManagementRoleAssignment -Role "Mailbox Import Export" -User <username>
No cmdlets for .pst export in Office 365
If you then look for the cmdlets for importing and exporting .pst files, you quickly realize they are not available in Office 365.
Apparently, from Microsoft's point of view, there seems to be no reason to migrate away from the cloud. As for backup purposes, there are dedicated programs like Veeam Backup for Office 365 or Altaro Office 365 Backup.
However, there is a way for an administrator to export Office 365 mailboxes to a .pst file. The solution here is eDiscovery. This TechNet article contains basic information about this feature.
Configuring eDiscovery
To use eDiscovery, log into the Office 365 portal (https://admin.microsoft.com or https://portal.office.com) and navigate to the Security & Compliance section. Alternatively you can directly enter the URL https://protection.office.com. Follow the Permissions link in the navigation pane.
Select eDiscovery Manager from the permissions list. On the right-hand side, a window should now open in which you can configure this permission.
First, you should check whether Export is included under Assigned roles. If not, the subsequent export to a .pst file will not be possible.
It is important to add any user who will later perform the export as the eDiscovery administrator.
In the next step, select Content search in the left navigation bar under Search.
Here you define a new search, and as a rule, you will not enter any keywords at this point. To avoid searching all of Office 365, it is advisable to limit the search to specific locations. We only want to search for mailboxes in Exchange and not get results from SharePoint or OneDrive.
Therefore, it makes sense here to activate the slider for Exchange email. Under Add Conditions, you can refine the search as much as you want, but this is not required for this scenario.
Clicking on Save and Execute saves the search under a defined name.
After starting the search, you can go back to the overview. A short refresh will display the search job created earlier.
If you click on it, the details of the job become visible.
You can now start the export by clicking on the More button.
Here you can select different options on how to export the files. For example, you can specify whether to store each mailbox in its own .pst file or share a common file with others. For the purpose of this test, I have left everything as the defaults.
Now it seems the export depends on the browser you are using. With Google Chrome, I got a client error, and the export stopped. In Microsoft Edge, this problem did not occur.
After clicking Export to complete the query, you can now click Export again in the upper bar to see the export job. If this does not display, you should refresh the browser window.
By clicking on the export job, you can now initiate the final save to local storage.
It is important that you copy or store the export key, as you will need it again later on. Click the Download results button to start the export.
This will launch the Microsoft Office 365 eDiscovery Export Tool setup. This is quite small and should install in a few seconds. The tool now asks for the export key you saved earlier and for a location for the .pst files.
The export to the local computer will then start; it finished after a few seconds because my mailboxes are not that big.
My destination folder now contains the exported .pst files of my mailboxes. There are some additional reports about the export; however, they are not that significant.
Subscribe to 4sysops newsletter!
You can now open the .pst file in Outlook as usual. However, you will notice that the folder structure looks slightly different than you would expect from a normal .pst export via PowerShell from Exchange.
Hi Roland, thanks for posting these instructions, they are the most complete I’ve seen as I’ve scoured the web for this. There is one thing that I’ve seen missing from all of the instruction sets, and that’s how to actually export an individual users mailbox to PST. To do this, follow all the steps up to the “Modify Location” step. Instead of clicking on the “Exchange” slider, click on the blue text for “choose users groups or teams”. In this area, search for the email address of the mailbox you want to export. Select it, then return to the Search window and now click Save & Run. The end result will be a proper mailbox export. Any other way will just result in a collection of emails that the user’s email address appeared in. Not the same thing as a true mailbox export, as the user’s email address may be found in *other* user’s email, which could create privacy issues for an employee who might inherit the resulting .PST file.
The PST file is exported using the eDiscovery PST Export Tool.