| 用途 | 命令行按条件查询事件 |
|---|---|
| 语法 | wevtutil qe <通道> /q:"*[System[(Level=1 or Level=2)]]" /rd:true /c:20 /f:text |
| 格式 | text、xml、renderedxml、json(版本相关) |
常用示例
常用示例
wevtutil qe System /q:"*[System[(Level=1 or Level=2) and TimeCreated[timediff(@SystemTime) <= 86400000]]]" /rd:true /c:20 /f:text
wevtutil qe Application /q:"*[System[Provider[@Name='Application Error']]]" /c:10 /f:textXPath 里的时间单位是毫秒:86400000 = 24 小时,适合写“最近一天”的巡检。