Exporting emails from multiple user accounts in exchange online into local storage

I need to export out all "older than one year" emails from approximately 150 users on Exchange Online (Office 365) into local PST files.

What is the best / easiest / quickest way to go about it?

The old emails need to be removed from their inboxes so that only the PST archive copies exist.
Martin AndelSenior IT AnalystAsked:
Who is Participating?
 
CodeTwo SoftwareSoftware DeveloperCommented:
PST files are not the most reliable option, but if you need to do this, I would go with the Office 365 eDiscovery feature. See how to export mailboxes to PST. When you finish the export, use the Search-Mailbox cmdlet to delete files older than one year.
If you are looking for a more reliable option than the PST backup, take a look at CodeTwo Backup for Office 365. You can test it for 30 days for free.
1
 
Martin AndelSenior IT AnalystAuthor Commented:
I don't really need the backup to be honest. I just want to get rid of everything older than one year and do the PST backup sort of "just in case." We archive all our inbound, outbound and internal email via a 3rd party cloud-based spam filter service.

Can you please give me a working example of the PS cmdlet for time-ranged bulk delete?
0
 
CodeTwo SoftwareSoftware DeveloperCommented:
This should work for deleting all mailbox elements received before the specified date:
Get-Mailbox | foreach ($mailbox in (get-mailbox)) {Search-Mailbox -id $mailbox -SearchQuery 'received<#Date in MM/dd/yyyy format#' -DeleteContent -Force}

Open in new window

Be sure to test it before using it in the production environment.
0
WEBINAR: 10 Easy Ways to Lose a Password

Join us on June 27th at 8 am PDT to learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees. We'll cover the importance of multi-factor authentication and how these solutions can better protect your business!

 
Martin AndelSenior IT AnalystAuthor Commented:
So that goes through all mailboxes in the Exchange Online tennant? And I presume the only variable that I'd need to change in the string is the date range?
0
 
CodeTwo SoftwareSoftware DeveloperCommented:
Yes, the cmdlet will go through all mailboxes in the tenant. If you want to limit the mailboxes, you have to filter the results of the get-mailbox, or, for example, use
Get-DistributionGroupMember <"Distribution Group name">

Open in new window

instead.
1
 
Martin AndelSenior IT AnalystAuthor Commented:
Awesome, thanks!
0
 
Martin AndelSenior IT AnalystAuthor Commented:
Great help, thanks!
0
 
Naveen SharmaCommented:
Use eDiscovery Export method to export mailbox items to PST:
https://www.nucleustechnologies.com/how-to/backup-exchange-online-mailboxes-to-pst.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.