Tuesday, July 5, 2011

Rexx WMI Example using ExecNotificationQuery with __InstanceCreationEvent

You can download the scripting program for generating these scripts at:

http://www.planetmps.com/wmiscriptsENQ_C.html

locator = .OLEObject~new("WbemScripting.SWbemLocator")
svc = locator~ConnectServer(".", "root\cimv2")
svc~Security_~AuthenticationLevel = 0
svc~Security_~ImpersonationLevel = 3
objs = svc~ExecNotificationQuery("Select * From __InstanceCreationEvent WITHIN 1 where targetInstance ISA 'Win32_Process'")
do obj over objs
    do prop over obj~Properties_
    end
exit
end

No comments:

Post a Comment