Update: This post was updated on July 27, 2022 to reflect the latest developments in the Microsoft Purview compliance center and Microsoft 365 Defender admin center user interfaces.
In this article, I am going to show you how to export Office 365 mailboxes to PST files using an Office 365’s native in-place eDiscovery mechanism as a workaround.
The reason why you may need to use it is that Microsoft doesn’t provide any tools dedicated specifically for this purpose (like the New-MailboxExportRequest cmdlet in on-premises Exchange). In fact, if you want to export mailboxes to PST files to e.g. add a layer of extra protection to your Office 365 data or migrate away from Office 365, the eDiscovery mechanism is your only option, other than opening the mailboxes in Outlook and using its Import/Export functionality.
IMPORTANT: eDiscovery is supported in all Exchange Online plans and in selected Office 365 plans. For more see this Microsoft article.
Note that this solution can also be used in Exchange 2019, 2016 and 2013.
If you want to learn how to simplify some of the tasks in the eDiscovery with PowerShell, take a look at this article.
Table of contents:
- System requirements
- Steps to export Office 365 mailboxes to PST using eDiscovery
- Office 365 eDiscovery export problems
- Export Office 365 mailboxes to PST using CodeTwo Backup for Office 365
- 32 and 64-bit versions of Windows 7 and later versions
- Microsoft .NET Framework 4.5
- Internet Explorer 10 and later versions or Microsoft Edge. Mozilla Firefox or Google Chrome works only with the ClickOnce add-in installed
As already mentioned, this is a workaround, so most of the below steps are going to be related to setting up in-place eDiscovery. The PST export comes at the end (it is performed via a ClickOnce application).
Steps to export Office 365 mailboxes to PST using eDiscovery
- After logging in to your Office 365 portal, access the Microsoft 365 admin center as shown in the below image.
- In your Microsoft 365 admin center, expand Admin centers and click Security.
- In the Microsoft 365 Defender admin center, go to Permissions > Email & collaboration roles > Roles and click eDiscovery Manager role group.
This and the next step are necessary because you need to be a member of the eDiscovery Manager role group to be able to use eDiscovery features.
- In the eDiscovery Manager role group properties pane, add your account to the eDiscovery Administrator list using the Edit button and following a few simple steps.
The role group normally has the following roles assigned: Case Management, Compliance Search, Export, Hold, Preview, Review and RMS Decrypt. In some cases, the Export role is missing. If that is the case, make sure you add it by clicking the Edit role group button.
- Now, log in to the Microsoft Purview compliance portal, go to Content search, and click the New search button.
Important note: If you are missing the Content search option, it is most likely related to the eDiscovery permissions you set in the previous steps. Changes in the eDiscovery permissions might take even up to 24 hours to apply. 24 hours after you set the permissions (or less, in my case it happens almost instantly) the tool should work just fine. The issue with permissions might also result in the lack of the export/download option later on.
- A wizard that lets you customize all aspects of a content search opens. First, name your search and go to Locations. This page lets you specify which mailbox data you wish to export. Mind that selecting all locations will cause the tool to search through your SharePoint online and Public Folders database, which might take a long while. If you want to export data from all mailboxes, select Exchange mailboxes only (1). You can further narrow down your search to specific users groups or teams by clicking the link (2) and selecting specific items in a picker pane.
- Apart from the location filter, the wizard gives you a number filtering options that are available on the Conditions page:
- query language/region;
- keywords/phrases (separated by logical operators: AND, OR, NEAR, NOT, etc.)
- conditions, including related to time, message fields & properties and many more (use the Add condition button).
If you want to export all mailbox data, just do not add any conditions or keywords.
- In the last step of the wizard, click Submit and Done to close the wizard and start your search immediately.
- The search will be performed in the background – you can check the status of your search by clicking it on Search tab.
- In the pane that pops up, you can see if the search has been completed and the details concerning its result. If it’s completed, click the Actions button and choose Export results.
- In this window, you can choose if you want to include encrypted files. You can also decide how to export the Exchange content. I find the default options to be the most reasonable for a backup – each mailbox has a separate PST file, which makes recovery a bit easier if necessary. Do not check the Enable deduplication option, unless you want the search results to be exported to a single PST file. For more on unsearchable items see this Microsoft article.
When you are finished, click Export at the bottom of the window.
- The wizard starts to export data. Go to the Export tab and choose your search again to see its progress.
- You can either wait for the task to finish or click Download results right away. If you start to download the results before the export is completed, the download and export tools should finish at the same time. Another important part of this window is the special Export key. Remember to copy it, as it will be required in the ClickOnce application that will start in the next step
- A ClickOnce application called eDiscovery PST Export Tool will start. Paste the export key copied in the previous step. Next, point the Export tool to a folder where you want to save the PST files.
After you click Start, the tool will begin the export. When it completes, close the application.
After performing the export, you can delete the eDiscovery search by selecting it on the Search tab, clicking the Actions button and Delete.
Office 365 eDiscovery export problems
While exporting mailbox data to PST via eDiscovery might be a good workaround in some cases, you should prepare yourself for some possible problems:
PST Export button is missing or the export cannot finish
There are two possible reasons for this problem to occur:
- Your account does not have the mailbox import/export role assigned, or the role-assignment changes have not reached the eDiscovery yet. The quickest way to assign it is to use a PowerShell cmdlet:
New-ManagementRoleAssignment –Role “Mailbox Import Export” –User “user name”
- You browser does not support exporting results. The export is performed via a click-once application, which means that it will only work with Internet Explorer or Microsoft Edge browsers. To make the export work on Mozilla Firefox or Google Chrome, you can use a click-once extension.
The Office 365 eDiscovery export creates duplicates
The export to PST often creates duplicated items. This is because eDiscovery often finds several instances of the same email message and by default treats them as separate objects. This can be easily mitigated by checking the Enable deduplication option (refer to step 11 of the guide above). Mind that de-duplication mechanism is not a perfect solution. The mechanism has a few limitations, for example, it is known to mark some unique items as duplicates, therefore excluding them from the export.
Some additional problems you might run into after the export is finished
- Items are missing,
- PST file got corrupted,
- The export takes too long,
- Search is extremely problematic.
Those problems; unfortunately, do not have a quick fix. In fact, using a bit outdated PST file type for backup or archiving purposes is not a good idea. To successfully backup and archive your Office 365 mailbox and SharePoint data without all those problems, you would require a third party tool, like CodeTwo Backup for Office.
Export Office 365 mailboxes to PST using CodeTwo Backup for Office 365
If you are looking for an easier and faster way of creating PST files that playing with an eDiscovery search and export, you can use a third party solution like CodeTwo Backup for Office 365. The program comes with the intuitive console, where you can first back up your mailbox data to local storages, and then archive it to PST files.
As the program has the built-in Scheduler, you can easily automate the archiving process. This way the archive job will start on its own at the scheduled time.
The program comes with a trial so you can download a free version of CodeTwo Backup for Office 365 and test it directly in your environment. The trial version gives you actually the same feeling as the full version with only two limitations – it works 30 days and allows to restore up to 5 items per folder (if you would like to test the restore feature as well).
All in all, using PST files as the backup method is rather a bad idea. Their proneness to corruption, low to none item-search effectiveness, and poor management options make this method rather unsafe and hazardous for backup or migration purposes.