Leaked source code of windows server 2003
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

  1. use OLE;
  2. use Win32;
  3. $service = Win32::OLE->GetObject("winmgmts:");
  4. $events = $service->ExecNotificationQuery ("select * from __instancecreationevent where targetinstance isa 'Win32_NTLogEvent'");
  5. while (true)
  6. {
  7. print ("Waiting for next event...\n");
  8. $NTEvent = $events->nextevent (10000) || last;
  9. print ("$NTEvent->{TargetInstance}->{Message}");
  10. }
  11. print ("\nfinished\n");