我正在尝试建立一个事件 ID 列表,可用于确定机器何时关闭、启动、锁定和解锁。到目前为止,我发现了 6 个似乎是最佳候选者的事件 ID,但我想知道是否有更好的方法来确定它。
以下是我发现来自“电源故障排除程序”、“User32”、“EventLog”和“Microsoft Windows 安全审核”来源的有用的事件 ID 列表(1、1074、6005、6006、4800、4801) . 这些来自 Windows 10 (v1511),目前 Windows 10 是我唯一的目标要求,因为这是所有客户端计算机运行的内容。

这是我建立的一个示例过滤器查询
<QueryList>
<Query Id="0" Path="System">
<!-- Shutdown -->
<Select Path="System">*[System[Provider[@Name='User32'] and (EventID=1074) and TimeCreated[@SystemTime >= '2017-11-28T00:00:00.0000000']]]</Select>
<!-- Event Service Stop/Start -->
<Select Path="System">*[System[Provider[@Name='eventlog'] and (EventID=6005 or EventID=6006) and TimeCreated[@SystemTime >= '2017-11-28T00:00:00.0000000']]]</Select>
<!-- Startup -->
<Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Power-Troubleshooter'] and (EventID=1) and TimeCreated[@SystemTime >= '2017-11-28T00:00:00.0000000']]]</Select>
<!-- Machine Lock/Unlock -->
<Select Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and (EventID=4800 or EventID=4801) and TimeCreated[@SystemTime >= '2017-11-28T00:00:00.0000000']]]</Select>
</Query>
</QueryList>
Run Code Online (Sandbox Code Playgroud)
我故意将查询中的源分开,它们可以连接在一起,但这牺牲了 IMO 的可读性。 …