lsaregevent.py 507 B

12345678
  1. import win32security, win32event
  2. evt = win32event.CreateEvent(None,0,0,None)
  3. win32security.LsaRegisterPolicyChangeNotification(win32security.PolicyNotifyAuditEventsInformation, evt)
  4. print("Waiting for you change Audit policy in Management console ...")
  5. ret_code=win32event.WaitForSingleObject(evt,1000000000)
  6. ## should come back when you change Audit policy in Management console ...
  7. print(ret_code)
  8. win32security.LsaUnregisterPolicyChangeNotification(win32security.PolicyNotifyAuditEventsInformation, evt)