Read Specific Windows Event Log Event

后端 未结 3 513
-上瘾入骨i
-上瘾入骨i 2020-12-25 09:04

I am working on a program and need ot know how I would read a specific entry to the Windows Event Log based on a Record number, which this script will already have. Below is

3条回答
  •  庸人自扰
    2020-12-25 09:33

    There is a python library now (python 3 and up) that will do what you're asking called winevt. What you're looking for could be done via the following:

    from winevt import EventLog
    query = EventLog.Query("System","Event/System[EventID=27035]")
    event = next(query)
    

提交回复
热议问题