Monday, July 4, 2011

Kixtart WMI Example using Instances

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

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

$locator = CreateObject("WbemScripting.SWbemLocator")
$svc = $locator.ConnectServer(".", "root\cimv2")
$svc.Security_.AuthenticationLevel = 0
$svc.Security_.ImpersonationLevel = 3
$ob = $svc.Get("Win32_Process")
$objs = $ob.Instances_
for each $obj in $objs
    for each $obj in $objs
    next
Exit For
next

No comments:

Post a Comment