[Update]: This post was updated on July 27, 2022 to reflect the latest developments in the Microsoft Purview compliance portal and Microsoft 365 Defender portal 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
System requirements
- 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
- Log in to the Microsoft 365 Defender portal.
- Go to Permissions > Email & collaboration roles > Roles and click the 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.
Hi, while exporting the mailbox to pst, does it include In-Place Archive as well?
Hi Rakesh,
While using Content Search in eDiscovery, archive mailboxes are searched as well. This means that during the export, they are included as well.
Hmmm this seems like a lot of extra work. Especially if you are not blessed with access to e-discovery. While there doesn’t seem to be a solution that is as simple as a new-mailboxexport request letting MRS do all the work, I think my method for getting a PST is easier:
I keep a licensed shared mailbox in my profile. Someone wants the mailboxes of two sales guys that have details to a 2 billion dollar contract in their mailboxes (silly example – run with it), and now they are soft-deleted. I use:
New-MailboxRestoreRequest -SourceMailbox -TargetMailbox -TargetRootFolder “UniqueIDforsalesGuy” -AllowLegacyDNMismatch
Run for both at the same time if not too large. Check for when complete. Export the contents of each folder to a separate PST.
Sure, the manual export is always an option. It might be troublesome, though, if you want to get PST files for each and every mailbox.
Either way, I’m not a fan of PST files and their reliability.
Hi,
I’m using an administrative account with a mailbox and license but I cannot add my account to the eDiscovery Administrator… it’s no listed. Because of this I can’t get “export result” button.
Any idea…
Thanks in advance.
Hi Francesco,
Try contacting your global admin to see if they can add you to this role group. If you are the global admin, then you probably need to contact Microsoft 365 support to get this resolved.
thanks for a great article. I need to export a few user mailboxes to PST
How can i export the Archive mailbox for each user ?
Unfortunately, at this moment there is no switch or filtering option for archives.
Is there any limitation or difficulties regarding size limit to export all the email accounts in pst file and download it? For an example if we have 100 accounts with each mailbox size is 10GB which means 1TB of data need to export in pst and download from Admin console. I have experienced of generating and download small size report from Microsoft admin console.
Hello Mohammad,
There are a few problems related to large PST files. First, eDiscovery mechanism splits larger results to 10GB PST files. 1 TB of data will be split into (at the very least) 100 PSTs. Handling multiple PSTs on its own is troublesome, but the worse problem is that the larger the PST file, the more likely it is to be corrupted.
Sorry but the admin center panel was changed. Now Security and Compliance are splitted in two separated items on the menu. I don’t find the correct menu to change permission to e-discovery. Thanks in advance.
That’s true, the admin center has changed and I mention it in my other article. However, not everything has been migrated, eDiscovery mechanism included. You can still access the old Office 365 Protection center at: https://protection.office.com/homepage. I’ll make sure to update the article when something changes.
This seems like a lot of work. Wouldn’t it be easier to just give read and manage permissions to another user, let the mailbox sync to them and then export to a .pst file from Outlook?
Sure you can, but the question is how many mailboxes you need to export and how many you are willing to export manually. You can give full access permissions to all mailboxes at once and allow automapping, but having more than 10 in a single Outlook instance usually causes heavy lag.
The plus of export via eDiscovery is that you can get them all at once. Each one in a separate PST file. It is not a perfect method, but it works.
If you can’t see the PST EXPORT button – make sure you are using
Microsoft EDGE – Chrome etc doesn’t work with this.
The export works with Internet Explorer, too. Chrome and Firefox can be used, but require a ClickOnce extension.
I had managed to get the search to run. However the ‘Export results’ button is missing. I only see a ‘Export report’ button.
My PC has the required software, any idea?
Most probably, the account you are using does not have the Mailbox Import Export role assigned to your account. This role is required to export and is not included in any Role Group by default.
Hi,
is it possible to Backup the In-Situ-Archive to PST?
Otherwise i have no full backup from the users data.
Thanks
Regards
Maik
Hi Maik,
When you use Content Search in eDiscovery, archive mailboxes are searched as well. This means that during the export, they are downloaded as well.
wow thank you for the information
And now I’m quitting Microsoft; everything is complicated for admins also they generate errors from every update I guess everyone departments want to hide sources or cooperate? Linux all the way now, I will not look back ever again.
Thanks for the great sharing, you made my day!
I’m going to guess that this is not going to work if the mailbox has In-Place or Litigation Hold enabled.
Hi Anthony,
On the contrary, the primary reason to use the eDiscovery search tool is when mailboxes are on hold. In fact, the eDiscovery mechanism and the Search-Mailbox cmdlet are the only way to search through purged items (that is if there is the right retention policy or hold in place).
When I click Export at step 13, I am getting this error:
Parameter Scenario is not a valid URL option for cmdlet New-ComplianceSearchAction.
Parameter name: parameter
Any ideas?
Hi Brandon,
This issue usually comes up when there is some kind of problem with permissions. In other words, either the permissions have not yet propagated throughout the tenant or were not assigned for the chosen account. First, make sure you have the required permissions (see step 4). You can also try adding yourself as an eDiscovery Manager (in addition to the Administrator). It should not take more than an hour for the permissions to start working. Also, signing out and in again might help.
information out dated
useless.
There have been some changes concerning the layout of the eDiscovery function; however, its functionality has not changed. I am going to update the screenshots in the article later this week, stay tuned!
Hi if you get error:
Deployment and application do not have matching security zones.
you need to install, ExtensionMeta4 ClickOnce Launcher in Chrome :
https://chrome.google.com/webstore/search/clickonce%20for%20microsoft?hl=en
ANd then it works as charm, gots this form MS support
Hi Linas,
thank you for the contribution. Just to mention, this information is already included in the System requirements section above.
Hi Adam,
Thanks for the tip, has been really handy.
We’ve ntoiced lately when we’ve used the eDiscovery tool to export user mailboxes, it is also including all files the user has access to in our SharePoint (Office365).
Has anyone else had this issue and/or know the way to exclude SharePoint files/documents from the search/export?
Hello Nick,
In the first step of configuring an eDiscovery search, you have the option to either Search all sites, or Choose specific sites to search. If you choose the latter and do not specify any sites, there should be no SharePoint files included in the export.
Thanks for the very informative write-up. My organization is currently in a hybrid mode. We’ve already moved all the archive mailboxes from Exchange on-prem to Office 365. The primary mailboxes are still on-prem while we resolve certain issues with vertical applications, etc. Archive mailboxes are not enumerated when there is no associated primary mailbox so there doesn’t seem to be any means to export an archive mailbox in that situation except to connect Outlook to the mailbox and export the PST. Does anybody know of some other means to export an archive mailbox when the primary mailbox is on-prem?
Hi Jonathan,
Migration from Office 365 to an on-prem Exchange or to PST files is quite problematic – the only way to do this natively is eDiscovery or manual export. The only dependable way to export mailboxes (and archives) from Office 365 is using a third party tool, like CodeTwo Office 365 Migration.
Hello,
I have a problem.
I can export to PST file using ediscover tool, but my PST file is a mirror of my office365 account.
How I can export email for a PST file and automatic delete email on the source?
thanks,
I can propose two solutions. Both require PowerShell.
You can use New-MailboxExportRequest to export emails and follow up with Search-Mailbox with the -DeleteContent switch. Just remember to use the same search parameters. This way you will export chosen emails to PST and delete them from source mailboxes afterwards.
Another option is to use Search-Mailbox cmdlet with -TargetMailbox, -TargetFolder and -DeleteContent attributes. Instead of generating a PST file, it will result in copying chosen emails to another mailbox and deleting from the source.
You can check the following articles if you need help with the cmdlets I mentioned:
Exchange 2016, 2013, 2010 mailbox backup by export to PST (PowerShell)
How to delete email from mailboxes on Exchange 2016 / 2013 / 2010 / Online
Does the pst export / file also includes contacts and calendar informations? Or is this only a mailbox / e-amil export? Thanks for your support.
By default, the pst file includes all message types: emails, calendars, contacts, etc. You can use filters and conditions to export only emails or to exclude some message types if you like (see Step 7 of the guide above).
This trick was extremely helpful! Although I noticed that it now has a limited lifespan. Microsoft has this notice on the Compliance Management screen:
Starting July 1, 2017, you won’t be able to use the EAC to create searches in Exchange Online. Please start using Content Search in the Security & Compliance Center. In Exchange hybrid deployments, searches run from your on-premises organization aren’t affected by this change. Learn more about content search.
Will there be another method or is Microsoft just shutting down this workaround?
Yes, I got this same message. However I was able to export a mailbox by going to the Security and Compliance Center and adjusting the permissions in line with the above (There are similar options). Then go to Search and Investigation -> eDiscovery. Create a case (“PST Export”). Open that case using the button to the left of the line and then click on the Search Tab. From here you can define the search similarly to the steps above. Once the results of the search have finalised, click on the export button as found in step 9 above. The result can then be found in the Export tab where you can Download exported results from the hyperlink on the right panel. The only additional step is to copy the Export Key to the clipboard to then paste back into the ClickOnce Export Tool. Essentially, given the information above and performing similar operations through the Security & Compliance Admin Console, you can achieve the same result.
Thank you for such a detailed description! That is right, the functionality is not blocked, it is just moved to the Security and Compliance Center. I will update the article before it is outdated, so that it gives a detailed step-by-step walkthrough of the new method (like Jonathan wrote, it is not that different, anyway).
In the meantime, you can watch the video guide on how to export Office 365 mailboxes to PST files – it shows how it is done using the new method.
Hi! First, thank you so much for the trick, it’s been most helpful!!
Now, the question: Do you think could be a way to use this same workaround for the public folders?
I would like to extract a pst for each public folder we have (ideally, in batchs, but if I had to do it manually for each folder it doesnt matter).
I have already tried mail-enabling the public folder, but you can only browse for user mailboxes.
Thanks again!
Hi Jose,
Yes, you can use eDiscovery to back up public folders.
Just make sure you check out Search all public folders in step 6. You cannot limit your search to a specific public folder, but you can use certain keywords to limit your search. As far as I know, public folders do not have to be mail-enabled for eDiscovery to find them.
It’s worth to mention that when you start importing the PST via the export tool it asks for authentication. If your Office 365 account it MFA (two factor authentication) enabled, you have to create an app password in order to authenticate. The PST tool doesn’t support ADAL libraries.
It’s very helpful
Went through the process but no download optioned appeared.
Hi Tim,
Please make sure you have completed the step 4 and that your account has the Mailbox Import Export role assigned. In my case, it took about half an hour before the changes were applied. Sometimes, logging out and in the tenant again might help. If the icon is not there after a considerable amount of time, you might want to consider raising a support ticket with Microsoft.
Hi,
I’ve been trying to follow you guide but I’m stuck on step 4 : the + button for adding roles in discovery management is non existant on my admin console.
Am i missing something ?
Hi Thomas,
If you cannot add new roles to Discovery Management Role Group, please try creating a new Role Group. Then add the three Roles mentioned in step 4 to the new Role Group and continue with the article accordingly. You can also use PowerShell, just consult the Note below the step 4.
Hi Adam,
I am recieving this error below:
Following errors were detected during this operation.
* [10/30/2016 11:01:59 PM] System.Deployment.Application.InvalidDeploymentException (Zone)
– Deployment and application do not have matching security zones.
– Source: System.Deployment
– Stack trace:
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
I am not exactly sure what I am seeing here. Have you seen this before?
Hi Jeff, Do I assume correctly that this happens when you try to run the PST export tool in Step 10? What browser are you using?
Thumbs up for Stephens information.
I was running it on chrome and it didnt work.
I read this and moved over to Edge and BAM! It worked.
Thanks :)
Is it possible to export user archives from o365 using this method?
Hi Andrew, Yes, it is. They will be exported into PST files (https://support.office.com/en-us/article/Introduction-to-Outlook-Data-Files-pst-and-ost-222eaf92-a995-45d9-bde2-f331f60e2790).
Hi, how to export archive? I mean the archive in the separated tree, where all emails older than 2 years go…
thanks
bye
Hi Gianluca,
It depends how the archive was created. Be default, eDiscovery searches (and exports) users’ primary archive mailboxes (see Sources here: https://technet.microsoft.com/en-us/library/dd298021(v=exchg.160).aspx#using). But this only applies to Exchange archive mailboxes (https://technet.microsoft.com/pl-pl/library/jj984357(v=exchg.150).aspx).
– Adam
Worked really well. Thanks :)
The ediscovery tool or compliance center is NOT going to work if you have a large amount of data to export. For example, there is a 250GB download limit. In our organization, that is enough for less than one week of data.
The export tool is terrible, if you have a large organization, searches are very buggy and take 30 minutes per search. Because the tool is so bad, we are trying to go to another archiving system. Guess what, using this same buggy tool is the solution we are given to export, and even a 100GB export will not work or have a ton of errors. That’s two weeks. We are down to trying to export one day. Tons of errors for 100GB.
Do NOT listen when Microsoft says this will replace your current archiving system. It is a scam.
This does not allow you to export/download PST unless you have an Exchange Online Plan 2, therefore this does not work for us.
Thanks buddy , really helpful.
MAKE SURE TO RUN THIS IN INTERNET EXPLORER. I SPENT AN HOUR ON THE PHONE WITH MICROSOFT BECAUSE THE PROGRAM THAT RUNS WHEN YOU CLICK THE DOWNLOAD WOULDN’T WORK WITH MOZILLA FIREFOX.
P.S. Microsoft was useless.
P.P.S. Godaddy was super helpful even though it wasn’t their problem.
Good day! :)
Thats a great tip Stephen, thanks a lot.
Was wondering why it wont work on Chrome, then read your comment.!!
Seriously? Make sure you blame Microsoft when you’re incapable of using Google. It took me <5 seconds to Google it and figure out that you can, indeed, use Google to export PST by using a ClickOnce Chrome extension.
Google Chrome and Firefox extension**
EXACTLY… USE EXPLORER OR YOU ARE GONNA HAVE A BAD TIME~!
thanks Adam, works a treat however the mailbox I exported is massive so it split it into multiple 10Gig pst files.
Is there a way to consolidate them all into one PST?
Hi,
Yes, it is possible. To merge PST files into a single file, you can use the Import/Export option in Microsoft Outlook.
Here you will find more details: http://msoutlookworld.blogspot.com/2015/10/how-to-combine-multiple-pst-files.html.
Just keep in mind that using Outlook data files larger than 10 GB can cause Outlook to work inefficiently and inconsistently.
All the best,
Adam
In my account I cannot complete Step 4 because there is no plus and minus buttons to add new Roles. What should I do?
Hi Igor,
This may be a permission issue.
To verify that, please check this Technet article (the “What do you need before you begin?” section): https://technet.microsoft.com/en-us/library/jj657480(v=exchg.150).aspx.
You may also need to run the New-ManagementRoleAssignment cmdlet to add roles from step 4. Here you will find more details: https://technet.microsoft.com/en-us/library/jj657480(v=exchg.150).aspx (the “Add a role to a role group” sections).
Let me know whether it helps!
Best regards,
Adam
I was able to successfully export using an administrative account that had no mailbox or license. I did have to log off and back on after adding the permissions to the account for the export option to appear. I also did have to add the “Mailbox Import Export” permission to the Discovery Management Role manually.
@Adam; the account you use to do the export alse needs to have an active mailbox. If this is an administrator account without an active mailbox temporarily assign a license to this account.
Thanks “Adam the 32-bit Aardvark”! I really appreciate you posting this!
One minor comment: I was not able to add the Mailbox Import Export role but found that if i ticked the box to “Search All Public folders” when creating the eDiscovery it then let me do the save to PST option anyway.
If i did not check the box for “Search All Public folders” the download button (arrow) would not show up.
Hi Jason,
Did you get any errors when you tried to add the Mailbox Import Export role?
Best regards,
Adam
It takes some time for the system to update with a new role. It also helps to log out and completely close the browser.
At the ClickOnce application step it did not work in Chrome but the obvious solution is to open it from Internet Explorer.
Thanks so much for these detailed instructions!
When I get to step 9 I don’t see the downward arrow. Help!
Hi David,
In step 4, please check if all 3 roles I talk about are included.
Best regards,
Adam
I have the same problem, no Download link/symbol is showing. YES I ensured all 3 roles are checked in Step 4 also… Tips?
What Office 365 plan are you guys on?
Hey David,
I had this same issue while i was logged in as the admin.
I couldn’t even add the admin to the member list in step 4.
Not sure if this is the solution, but this was a workaround that i did.
I created a new user and temporarily assigned it a license.
Gave that user admin rights and then added him to the list in step 4.
Afterwards, i signed out of my admin account and signed in with the new user i created. Went to that Ediscovery screen and now i was able to see the Download button. Oh, and DONT FORGET to run this on IE. It doesnt work on chrome as Stephen explained.
Hi Erwn,
Can you provide more details on how this issue manifested itself?
Best regards,
Adam