Tuesday, July 5, 2011

PHP WMI Example using ExecNotificationQuery with __InstanceCreationEvent

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

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

com_load_typelib("Microsoft WMI Scripting V1.2 Library");
$locator = new COM("WbemScripting.SWbemLocator");
$svc = $locator->ConnectServer();
$objs = $svc->ExecNotificationQuery("Select * From __InstanceCreationEvent WITHIN 1 where targetInstance ISA 'Win32_Process'");
$objs = $objs->Next($objs->Count);
foreach($objs as $obj)
{
   foreach($prop as $obj->Properties_)
   {
   }
 last;
}

No comments:

Post a Comment