Tuesday, July 5, 2011

Rexx WMI Example using ExecQuery

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

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

locator = .OLEObject~new("WbemScripting.SWbemLocator")
svc = locator~ConnectServer(".", "root\cimv2")
svc~Security_~AuthenticationLevel = 0
svc~Security_~ImpersonationLevel = 3
objs = svc~ExecQuery("Select * From Win32_Process")
do obj over objs
    do prop over obj~Properties_
    end
exit
end

No comments:

Post a Comment