I have a large mailbox (160k+ emails) on Microsoft 365 Business Premium that's running out of space.
The outlook clients (online and mac desktop) are hopeless for grouping and deleting emails in bulk, so I want to run powershell scripts (or some other kind of code/scripts) that will:
- Give me a summary of the count of emails per sender, ideally with a first and last sent date, so I can work out which senders has sent the most emails to the mailbox.
- Allow me to delete all the emails from a given sender (or list of senders in an array or csv file) so I can free up space in the mailbox.
I am a developer but I don't really know powershell - I've tried Get-MessageTrace but it's limited to the last 10 days, and I can't work out if Start-HistoricalSearch will be able to give me what I need.
I'm happy to try another method other than powershell if there's another approach.