Iva*_*van 15 windows command-line-interface logging
通常我可以打开计算机管理控制台,转到事件查看器管理单元,打开 Windows 日志文件夹,右键单击Application/Security/Setup/System子文件夹,选择清除日志并按Clear或Save and Clear按钮确认。
拥有足够的权限,如何在不提出确认请求的情况下通过使用命令行达到相同的效果?
Rya*_*ies 14
电源外壳。
PS C:\>Clear-Eventlog -Log Application, System
Run Code Online (Sandbox Code Playgroud)
默认情况下不提示您,但如果您想收到提示,您可以提供 -Confirm 开关。
编辑:
Get-WinEvent -ListLog Application,Setup,Security -Force | % { Wevtutil.exe cl $_.Logname }
Run Code Online (Sandbox Code Playgroud)
根据评论,这应该同时获得操作和管理日志。
wevtutil enum-logs将枚举系统中的所有日志,同时wevtutil clear-log将清除日志。对于您的情况,它将是:
wevtutil clear-log Application
wevtutil clear-log Security
wevtutil clear-log Setup
wevtutil clear-log System
Run Code Online (Sandbox Code Playgroud)
您还可以在清除时备份 wevtutil clear-log System /backup:backup.evtx
| 归档时间: |
|
| 查看次数: |
29755 次 |
| 最近记录: |