You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
403 B
16 lines
403 B
use OLE;
|
|
use Win32;
|
|
|
|
$service = Win32::OLE->GetObject("winmgmts:");
|
|
$events = $service->ExecNotificationQuery ("select * from __instancecreationevent where targetinstance isa 'Win32_NTLogEvent'");
|
|
|
|
while (true)
|
|
{
|
|
print ("Waiting for next event...\n");
|
|
$NTEvent = $events->nextevent (10000) || last;
|
|
|
|
print ("$NTEvent->{TargetInstance}->{Message}");
|
|
}
|
|
|
|
print ("\nfinished\n");
|
|
|