See Step 1 for instructions about how to connect.Ī maximum of 10 items per mailbox can be removed at one time. You have to use Security & Compliance Center PowerShell to delete messages.
If you aren't assigned the Search And Purge role in the compliance center (either directly or through a role group such as Organization Management), you'll receive an error in Step 3 when you run the New-ComplianceSearchAction cmdlet with the message 'A parameter cannot be found that matches parameter name 'Purge''. Being a member of Organization Management in Exchange Online does not grant the required permissions to delete email messages. These are separate role groups that give different permissions. The Organization Management role group exists in both Exchange Online and in the Microsoft 365 compliance center.