Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can use the following sample code to create a Windows Management Instrumentation (WMI) sink to monitor auditing and logging events:
//Create the WMI query and Event watcher and subscribe to events
ManagementEventWatcher watcher = new ManagementEventWatcher ("root/Default", "select * from PackageEvent");
ManagementBaseObject evtObj = watcher.WaitForNextEvent();
//Do what you want with the event