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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.