Hi,
I have issues bulk deleting emails from a shared mailbox which is used to store only logs and other reports no longer needed. To my surprise, it is not as easy as I thougth. We need to get rid of hundreds of thousands of emails.
Obviously outlook can't handle this. I tried to archive emails with it in the given mailbox by setting up citerias, but did not do anything, no error messages, nothing happened. Freezes when it has to deal wiht large sum of emails.
I tried these from powershell after connecting to EO and compliance center scc:
Starting a New Compliance search and then purge the results :New-ComplianceSearchAction -SearchName "Remove Phishing Message" -Purge -PurgeType SoftDelete/Hardelete. Nothing happens, no error messages, does not delete anything.
Deprecated search-mailbox command: Search-Mailbox mailbox1 -SearchQuery {Received:"1/1/2020..12/31/2022"} -DeleteContent. It is waiting for a while then returns the error:
ConvertFrom-Json : Invalid JSON primitive: .
At C:\Users\user1\AppData\Local\Temp\tmpEXO_atsy5x51.aez\tmpEXO_atsy5x51.aez.psm1:623 char:35
+ ... etailsToPSObject = ConvertFrom-Json $ErrorObject.ErrorDetails.Message
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
the New-MailboxSearch command does not even has syntaxes to delete results. Now I am really confused if it is even possible to mass/bulk delete emails from a shared (or any other type) mailbox, or I need to completely delete it and recreate it? Any clues would be appreciated.