Link to home
Start Free TrialLog in
Avatar of digitalco
digitalco

asked on

Delete emails from users Inboxes

Hi

This morning, an email went out to a whole bunch of people that shouldn't have! HR and management have now asked us if there's a way to remove the message from users' mailboxes before Monday morning. There are hundreds of mailboxes, so going into each one is not an option...any idea? We have the sender, recipient, and subject of this offending message.

Running Exchange 2007 SP2.
Avatar of Camy
Camy
Flag of United Kingdom of Great Britain and Northern Ireland image

Avatar of digitalco
digitalco

ASKER

Thanks...so reading around I would use this command below:

Get-Mailbox -Database DB1 | Export-Mailbox -TargetMailbox ExportMailbox -TargetFolder VirusData -SubjectKeywords "Virus message" -DeleteContentDo you know how I would use this command if I had the users in a text/CSV file?

Also, does this work on one mailbox at a time, or can do multiple?
ASKER CERTIFIED SOLUTION
Avatar of Camy
Camy
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ExMerge is a tool from Exchange 2003 but works on 2007 also

http://www.petri.co.il/delete_messages_from_mailboxes_by_using_exmerge.htm
How about:

Get-Content c:\users.txt | Get-Mailbox | Export-Mailbox -SubjectKeywords "Virus message" -DeleteContent
?? Anyone - and is there a way I can see a log of how we're progressing?
What you wrote there looks about right - did you test and find that it didnt work?

More information / confirmation of method - http://msexchangeguru.com/2011/05/06/delete-email/