Link to home
Start Free TrialLog in
Avatar of CiscoAzn
CiscoAznFlag for United States of America

asked on

Is there a way to remove a particular email from Exchange? I have over 200 users that received a spam email that i want to remove from their Outlook

Is there a powershell script or a way to remove an email from everyone by the sender's email address?
Avatar of Waddah Dahah
Waddah Dahah

if you are using Exchange 2010 open Exchange PowerShell and execute following command;

get-mailbox | Search-Mailbox -SearchQuery ‘from:virussender@virus.com ‘ -TargetMailbox “adminmailbox” -TargetFolder “DeleteVirus” -LogLevel Full –DeleteContent

Regards,
Waddah
Avatar of CiscoAzn

ASKER

what is the adminmailbox? the target is everyone's mailbox and is the "DeleteVirus" a folder I need to create?
The admin mailbox is whatever mailbox name you put in there...it could be yours or a another persons. The target folder is the folder in which to put a copy of the deleted email in the admin mailbox specified... you don't need to do this... you could just -deletecontent but if the email hit is wrong you'd need a copy to put back!

The search query could also be the subject name - which is probably a better target...   i.e. -searchquery 'Subject:"Subject in here"'
SOLUTION
Avatar of Waddah Dahah
Waddah Dahah

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
the question here is the source is everyone and not a specific mailbox like an adminmailbox. Just confused.
ASKER CERTIFIED SOLUTION
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
Thanks guys!