Eventquery command in Windows
The eventquery command lists events and event properties from one or more event logs.
Table of Contents
Applies to : Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012.
Note: The eventquery command is not accepted and is not guaranteed to be supported in subsequent versions of Windows. This tool is integrated in Windows Server 2003.
The eventquery command lists events and event properties from one or more event logs.
Eventquery command syntax
eventquery[.vbs][/s Computer [/u Domain**User [/p** Password]]][/fi FilterName][/fo {TABLE | LIST | CSV}][/r EventRange [/nh] [/v] [/l [APPLICATION] [SYSTEM] [SECURITY] ["DNS server"] [UserDefinedLog] [DirectoryLogName] [*] ]
Parameters
Parameter Description/ s Computer
Note
To run this script, you must be running CScript. If you have not set the default Windows Script Host to CScript, enter:
cscript //h:cscript //s //nologo
For example
The following examples show how you can use the eventquery command:
eventquery / l system
eventquery / l mylog
eventquery / l application / l system
eventquery / s srvmain / u maindomhiropln / pp @ ssW23 / v / l *
eventquery / r 10 / l application / nh
eventquery / r-10 / fo LIST / l security
eventquery / r 5-10 / l "DNS server"
eventquery / fi "Type eq Error" / l application
eventquery / fi "Datetime eq 06/25 / 00.03: 15:00 AM/06/25/00.03: 15: 00PM" / l application
eventquery / fi "Datetime gt 08/03 / 00.06: 20: 00PM" / fi "id gt 700" / fi "Type eq warning" / l system
See more:
- What is an IP address?
- Endlocal command in Windows
- Edit command in Windows
4 ★ | 21 Vote
Read More
- Sub-commands in nslookup Windows command (Part 3)
- Command at in Windows
- Set command in Windows
- Del command in Windows
- 10 useful commands in Windows you should know
- How to use the Net Use command in Windows
- How to use the option equivalent to the 'ls' command in Windows
- The command reg add in Windows