【问题标题】:How to report event to Windows System log in python如何在python中向Windows系统日志报告事件
【发布时间】:2022-01-13 18:19:21
【问题描述】:

我现在正在尝试向 Windows 报告事件日志,现在我正在使用 win32evtlogutil


        win32evtlogutil.ReportEvent(
            app_name, app_event_id,
            eventCategory=app_event_category,
            eventType=event_type,
            strings=[str(message)], data=app_event_data
        )

但这只是向应用程序日志报告事件日志?但是如何将事件报告到安全日志(见下图)?

【问题讨论】:

    标签: python windows pywin32


    【解决方案1】:

    从 Windows XP SP2+ ReportEvent() cannot be used to report security events 开始。您必须使用 Windows API AuthzReportSecurityEvent() 函数。 PyWin32 does not have a convenience binding for this function,所以你需要自己编写绑定。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-03
    • 1970-01-01
    • 1970-01-01
    • 2015-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-16
    相关资源
    最近更新 更多