Remove one email from Exchange 2007
I just thought of sharing a cmdlet which every exchange pro should have handy.
User Arnold sends an email to a set of people with the subject line “I am back”. Now, Stallone being the IT manager wants you to delete that email from the server side.
All you gotta do is to run this cmdlet:
Get-Mailbox -Server EXCH | Export-Mailbox -TargetMailbox TempMailbox -TargetFolder ” To Delete” -SenderKeywords email@example.com -SubjectKeywords ” I am back ” –StartDate “12/30/10” –EndDate “12/31/10” -ExcludeFolders “\Calendar”, “\Contacts”, “\Deleted Items” –DeleteContent –MaxThreads 10
- Server name is EXCH
- Data will be extracted from user mailboxes to the folder “To Delete” in a mailbox called TempMailbox
- Start date and End Date switch let you choose a date range
- Set the ExcludeFolders switch if you don’t want to search specific folders
- DeleteContent is the switch which deletes the email
- MaxThreads is to specify 10 mailboxes will be processed at a time
Now remember that Export-Mailbox first copies content to the destination mailbox before performing the search and the target mailbox can get quite large and create heavy IO. This is different from creating a transport rule to filter incoming messages.
Users can still use the “Recall” option in outlook.
KeyWords: Delete one email from Exchange, delete one email from all mailboxes, cmdlet to delete one emails from mailboxes, how to delete one email message in exchange, Powershell command to delete one email in exchange 2007.