wmi temporary consumer question (Win32_NtLogEvent Class)
From: barabba (barabba72_at_hotmail.com)
Date: 05/14/04
- Next message: jrex7: "group copy"
- Previous message: GDL: "System State"
- Messages sorted by: [ date ] [ thread ]
Date: 14 May 2004 09:53:51 -0700
Hi all,
I have a question concerning this temporary wmi consumer which listens
to the event viewer for new entries. I'm building (at least I'm trying
to) a management appliction and I'm putting all the pieces together.
However, see script below.
My problem is this: Once the event is delivered, I need to bind to it
in order to be able to extract some other properties (date, time,
source, category, message, description, etc. etc and have it sent or
displayed) of the event being delivered.
I have done something similar with processes, for example, but I can't
seem able to do the same with win32_NtLogEvent class.
Anybody has a tip on how to do this ? Of course echoing the value of
"colMonitoredEvents.NextEvent" raises an error.... (I thought I could
use this as a starting point to bind to the event...)
Thanks to all,
Bar
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate, (Security)}!\\"& _
strComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("Select * from __instancecreationevent where " _
& "TargetInstance isa 'Win32_NTLogEvent' ")
Do
Set objLatestEvent = colMonitoredEvents.NextEvent
strAlertToSend = "the event was raised"
wscript.echo colMonitoredEvents.NextEvent
Loop
- Next message: jrex7: "group copy"
- Previous message: GDL: "System State"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|