1
votes

About 3 or 4 times a week a clever spammer gets a message through my Sonicwall ESA and I need to scrub it from the exchange server. I'm network admin at a school, and students are suckers for that stuff. I run the following command as a global admin on my exchange server power shell:

Get-Mailbox -ResultSize Unlimited | Search-Mailbox -SearchQuery 'Subject:"Re-Please Update Your Password‏"' -DeleteContent

The odd thing is, about 99 out of 100 times it works. Within a few minutes the message with the aforementioned email disappears from my inbox and I go about my day. Once in a while, like today with the exact command listed above, I get a stubborn email that just won't go. At first I thought it was choking on the dash, so I changed the command to:

Get-Mailbox -ResultSize Unlimited | Search-Mailbox -SearchQuery 'Subject:"Please Update Your Password‏"' -DeleteContent

Still no joy. I'm not getting any errors, the command appears to run like normal. Anyone else run into this before? Any pointers?

Thanks.

-Bishop

1

1 Answers

1
votes

I've had similar issues, tho they were more obvious (multiple [8-12] spaces). So instead of running the command over and over increasing the spaces in the query or configuring an expression for every case, I just grabbed the subjectline itself.

find the message in your mailbox, pull the subject into a variable, use that as the Searchquery.

-FS