开发者

Powershell - MS Exchange E-mail Autoresponder

开发者 https://www.devze.com 2023-01-23 01:37 出处:网络
We\'ve currently got an issue where we\'re receiving a lot of bounced e-mails (from an auto generated e-mail) back from people where a specified e-mail address is not valid (failure notice).I need to

We've currently got an issue where we're receiving a lot of bounced e-mails (from an auto generated e-mail) back from people where a specified e-mail address is not valid (failure notice). I need to identify certain messages in the mailbox and respond automatically to them - as a newbie to Powershell I'm struggling a bit! I think I understand how to check for the occurrence of a string but I don't know how to iterate through an inbox to look at/get a handle on each message in turn and I don't know how to extract the subject or body text in order to analyse the contents and perform a string comparison. I fear this should be easy - but I can't find anything开发者_运维技巧 on the web that might do the job - can anyone help?


So just to clarify what you're looking for.

Mailbox A receives a large number of failure notice/bounce messages.

You'ld like your powershell script to search Mailbox A for every instance where the Subject line (or message body) contains "String X" and if there is a match, take some action?

Also, what version of Exchange are you using? You need to be at least on 2007 to use Exchange Command Shell. You'll then want to look over the Command Shell commands that can be run.

Look at the Exchange Message Tracking Log, and Pipe the results from one command you run to the next. Think of it like this...

(Run a command) | (Run another command on the results of the first command) | (Run a last command on the results of the second).

You can view an example on my website at: http://www.technoctopus.com/?p=223

While not exactly the same, it might get you moving in the right direction.

0

精彩评论

暂无评论...
验证码 换一张
取 消