I got a request recently. Due to a audit , they gave me like 100 keywords and delete those emails where ever they are in the server.
Exchange 2010 is much powerful and easy to do such task. We can use the discovery search feature to accomplish it.
Click the below Link – Make sure the Admin has appropriate Permissions
http://careexchange.in/deleting-a-specific-email-from-entire-organization-in-exchange-2010-2/
$search = ‘"expenses" OR "credit" OR "tax audit" OR ‘’Payment”’
Saved the 100 Keywords to $search in the above format.
To move Content to a Specific Mailbox -
This example searches all mailboxes in your organization for messages that contain the words in $search . The search results are copied to the administrator Mailbox in the folder Exportedmailbox
Get-Mailbox “EntermailboxName” | Search-Mailbox -SearchQuery $search -TargetMailbox "administrator" -TargetFolder "ExportedMailbox" -LogLevel Full
To Delete Content
For Specific mailbox
Get-Mailbox “EntermailboxName” | Search-Mailbox -SearchQuery $search –DeleteContent
For All mailbox
Get-Mailbox | Search-Mailbox -SearchQuery $search –DeleteContent
To Estimate how much mails you are going to delete
Get-Mailbox “EntermailboxName” | Search-Mailbox -SearchQuery $search -TargetMailbox "administrator" -TargetFolder "ExportedMailbox" –LogLevel Logonly