다음을 통해 공유


감사 및 로깅 이벤트에 대한 WMI 싱크 만들기

다음 샘플 코드를 사용하여 WMI(Windows Management Instrumentation) 싱크를 만들어 감사 및 로깅 이벤트를 모니터링할 수 있습니다.

//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

참고 항목

프로그래밍 가이드