M365 Exchange online - bulk delete Quarantined emails

 M365 Exchange online - bulk delete Quarantined emails

0. Connect from Powershell 

Connect-ExchangeOnline -UserPrincipalName  [email protected]
 
1.  Find quarantined emails using Powershell:

Get-QuarantineMessage -SenderAddress [email protected] -ReleaseStatus NotReleased
 
 
2.   Create variable with IDs

$id = Get-QuarantineMessage -SenderAddress [email protected] -ReleaseStatus NotReleased | select -ExpandProperty Identity

3. Delete or Release all:

Delete-QuarantineMessage -Identities $id -Identity 000


Get-QuarantineMessage -SenderAddress [email protected] -ReleaseStatus NotReleased | Release-QuarantineMessage -ReleaseToAll

Comments

Popular posts from this blog

Securing the Pi-hole with fail2ban to prevent DNS Amplification attacks

Reduce (shrink) and resize raw disk at Proxmox

How to clone CentOS server to another one