wevtutil
Windows CMD · System · reference only
What it does
Queries, exports and manages Windows event logs from the command line.
Syntax
wevtutil orden [argumentos] [opciones]
Options and parameters
qe registroQueries events (query-events) from a log such as System or Application.
elLists the available event logs (enum-logs).
gl registroShows a log's configuration (get-log).
epl registro ficheroExports a log to an .evtx file (export-log).
cl registroClears the events of a log (clear-log).
/c:NMaximum number of events returned.
/f:textReadable output format; also xml or rendered xml.
/rd:trueReads the most recent events first.
Usage examples
wevtutil qe System /c:3 /f:textShows the first three events of the system log.
wevtutil elLists the logs that can be queried.
wevtutil qe Application /c:5 /rd:true /f:textShows the five most recent Application events.
wevtutil epl System sistema.evtxExports the system log to a file.
Notes and common mistakes
- To read the Security log you need an administrator console.
- cl deletes the events irreversibly: export them first with epl.