Removing Emails from Exchange Database with Specific Subject using PowerShell

As an Exchange administration we often find ourselves dealing with panicked users who just sent an email they shouldn’t have.  If you don’t deal with it enough, you may not have the PowerShell command memorized, which is why its a good idea to document it so its easily accessible.  This command works well if the subject is very specific, if its generic, you may end up deleting emails you did not intend to.

Get-Mailbox –resultsize unlimited | Search-Mailbox –SearchQuery “Subject:Spiff Results as of 2-27-12” –DeleteContent