After thinking about using a Windows Service instead of a console application to send emails on specific Event Log entries I wanted to monitor, I decided to stick with the console application just because it’s so easy to implement. It requires no installation, no background process is running, and you can execute it from many batches for each type of message you’re wanting to email. I’ve considered doing the alerts via MSN Messenger, or RSS feed, but feel that email is still the most requested way that people want to receive their alerts.
I did add the capability of looking back as little as one minute using the -NUMBEROFMINUTES: argument.
Now you can use any combination of -NUMBEROFMINTUES, -NUMBEROFHOURS, and -NUMBEROFDAYS to look back the time you need to search the event log.
Here again is a complete list of the arguments:
-TOEMAIL: = ToEmail (Required)
-FROMEMAIL: = FromEmail (Required)
-SMTPSERVER: = SmtpServer (Required)
-NUMBEROFDAYS: = Number of Days to look back (Optional) if not set will use 0
-NUMBEROFHOURS: = Number of Hours to look back (Optional) if not set will use 0
-NUMBEROFMINUTES: = Number of Minutes to look back (Optional) if not set will use 0
/n = Send Email if there are no events (Optional)
/e = Send Errors (Optional)
/w = Send Warnings (Optional)
/i = Send Information (Optional)
-EVENTSOURCE: = Event Source (Optional)
-EVENTCATEGORY: = Event Category (Optional)
-EVENTMESSAGESEARCHSTRING: = Event Message Search String (Optional)
Here’s an example of the resultant email:
Please send any comments or suggestions on its usefulness.