office 365 delete messages Search for and delete email messages – Microsoft 365

– Open Windows PowerShell as Admin – Connect to Security & Compliance Center PowerShell $credentials = get-credential; Connect-ExchangeOnline -Credential $credentials $SccSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid/ -Credential $credentials -Authentication “Basic” -AllowRedirection; Import-PSSession $SccSession Or Go to https://docs.microsoft.com/en-us/powershell/exchange/connect-to-scc-powershell?view=exchange-ps for more information – Soft-delete messages New-ComplianceSearchAction -SearchName “NameOfTheSearch” -Purge -PurgeType SoftDelete – Hard-delete messages New-ComplianceSearchAction -SearchName…