Process to purge emails in office 365

   When an email with malicious content like virus, phising, spam, etc is coming to the company we need to delete those emails from the recipients Inboxes, sometimes in the companies, an employee send an email with incorrect or offensive content, this process applies as well.
Please follow this process:  

1. create the content. (based on             

Click on Content search
Create a new Search
Here we can put the conditions like sender, date range, subject, attachment, etc.
Click on save and run, its important input a name for this search.
In the open option, we can see all the searches saved
Once the search has finished, go to powershell and use the cmdlet New-ComplianceSearchAction
NOTE: to use the compliance module execute this script
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationNameMicrosoft.Exchange -ConnectionUri $UserCredential-Authentication Basic-AllowRedirection
Import-PSSession $Session -DisableNameChecking
You can validate the report and this task has been completed.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s