如何向 Windows 系统登录 python 报告事件
How to report event to Windows System log in python
我现在正在尝试向 windows 报告事件日志,现在我正在使用 win32evtlogutil
win32evtlogutil.ReportEvent(
app_name, app_event_id,
eventCategory=app_event_category,
eventType=event_type,
strings=[str(message)], data=app_event_data
)
但这只向应用程序日志报告事件日志?但是如何将事件报告到安全日志(见下图)?
从 Windows XP SP2+ ReportEvent()
cannot be used to report security events. You must use the Windows API AuthzReportSecurityEvent()
function. PyWin32 does not have a convenience binding for this function 开始,因此您需要自己编写绑定。
我现在正在尝试向 windows 报告事件日志,现在我正在使用 win32evtlogutil
win32evtlogutil.ReportEvent(
app_name, app_event_id,
eventCategory=app_event_category,
eventType=event_type,
strings=[str(message)], data=app_event_data
)
但这只向应用程序日志报告事件日志?但是如何将事件报告到安全日志(见下图)?
从 Windows XP SP2+ ReportEvent()
cannot be used to report security events. You must use the Windows API AuthzReportSecurityEvent()
function. PyWin32 does not have a convenience binding for this function 开始,因此您需要自己编写绑定。