I need a free way to monitor the Windows event logs and when a particular event is logged I need to kick off a VBS script. Is there a tool that can do this?

  • Did you find an answer to your question? If so, awarding the answer and an upvote would be helpful to future readers. – Wesley Aug 4 '11 at 23:39

You can roll your own using PowerShell 2.0 if it is installed on your server. Take a look at the Get-EventLog and Send-MailMessage cmdlets. Brush up on how PowerShell prefers to handle logical loops while you're at it.

From there, you can easily call any script that you want with cscript.exe

If you don't want to make your own log parsing script (it's not hard, promise!) then take a look at EventReporter which is a paid tool.

| improve this answer | |

This might be to over the top for what you are after but SCOM can do this type of thing http://www.microsoft.com/systemcenter/en/us/operations-manager.aspx

It has the ability to execute VB Script and also Powershell, the only thing with Powershell you have to use the Authoring Console, as the standard SCOM console does not support Powershell. http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14989

SCOM is a pretty good system and we use it at my work so we use it for this type of thing but as stated it might be to much for what you want.

| improve this answer | |
  • SCOM is not free however, he is looking for a free tool. – Lucky Luke Aug 3 '11 at 13:13

If you already speak vbscript, you can expand the script you have and monitor the event log directly over WMI. Here's what I use:

Set objWMIService = GetObject("winmgmts:" & _

Set colMonitoredEvents = objWMIService.ExecNotificationQuery _     
("Select * from __instancecreationevent where TargetInstance isa 'Win32_NTLogEvent'") 
  Set objLatestEvent = colMonitoredEvents.NextEvent 
  strTimeWritten = objLatestEvent.TargetInstance.TimeWritten
  strSource  = objLatestEvent.TargetInstance.SourceName
  strType  = objLatestEvent.TargetInstance.Type
' etc

Hope this helps.

| improve this answer | |
  • These are great responses! Thank you! I'll review them tonight to see which ones are the best fit! – msindle Aug 2 '11 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.