Temporary Event Subscriber

Update 11/12/2009: the vbscript below can be use in many ways, think of the options you have with this small script. After all, the goal of scripting or programming is to efficiently locate existing code, and modify for your use. And sometimes, if the rest of the world is lucky - maybe you'll share it with us. Nevertheless, this example only grazes the surface of event subscriptions. InstanceModificationEvent is deep down in the cimv repository and is often overlooked because most concentrate only in the Win32_ realm for their wmi scripting needs. Next up will be sink events, which is one of my favorites. A small demonstration can go a long way.

 

Description:
WMI monitoring script that issues an alert any time a service changes status (for example, a running service is stopped, a paused service is resumed, etc.).

 

Vbscript Code: (save as .vbs)

AttachmentSize
temporyeventsubscriber.txt630 bytes