Logs
Commands
eventvwr
Opens the Event Viewer (GUI).
wevtutil qe <LogName>
Retrieves events from a specific event log.
Get-EventLog -LogName <LogName>
View specified event logs.
Get-WinEvent -LogName <LogName>
View specified event logs.
Get-WmiObject -Class Win32_NTLogEvent
View specified event logs using WMI.
logman query
Lists the configured performance counter and event trace logs.
tracerpt <LogFileName>
Converts event trace logs or performance counter logs into a readable format.
type <LogFileName>
Displays the contents of a text-based log file.
View specified event logs using WMI and a custom query:
Get-WmiObject -Query "SELECT * FROM Win32_NTLogEvent WHERE Logfile = '<LogName>'"View specified event logs using CIM:
Get-CimInstance -ClassName Win32_NTLogEventView specified event logs using CIM and a custom query:
Get-CimInstance -Query "SELECT * FROM Win32_NTLogEvent WHERE Logfile = '<LogName>'"List of available event logs and the number of records in each log:
wmic nteventlog get LogFileName,NumberOfRecordsView specified event logs:
Viewing Application logs:
Search for SID and username:
EventID
EventID
Format to text removes UTC:
pstools show most recent logged in users: Type 10 Logons"
10 newest System logs?:
10 newest System logs?:
Collect informationn related to all Windows Event log instances containing successful logons, security log clearing and unexpected shutdowns -> desktop text file:
Retrieve a list of USB devices that have been attached with the associated friendly device description:
Check for PS Logging (PS3+)
Verify logging:
Enables Logging:
Disables Logging:
Registry Location:
Log location:
EventID
View logs by Event ID. This command is case-sensitive and has to be like this:
Find all events with EventID 4624 (Logon events) in the Security log
Find all events with EventID 1001 (Windows Error Reporting) in the Application log
Find all events with EventID 4624 (Logon events) in the Security log
Find all events with EventID 1001 (Windows Error Reporting) in the Application log
This gives the most recent entry of the PowerShell EventLog with an Event ID of 800:
Find all events with EventID 4624 (Logon events) in the Security log
Find all events with EventID 1001 (Windows Error Reporting) in the Application log
Find all events with EventID 4624 (Logon events) in the Security log
Retrieve events with EventID 4624 (Logon events) from the Security log
Content/Keywords
Find all events in the Security log that contain the username "JohnDoe"
Find all events in the Application log that have the keyword "Critical"
Find all events in the System log that contain the word "error"
Find all events in the System log that have the keyword "disk"
Date Range
Retrieve events in the Security log that occurred between two specific dates
Retrieve events in the Application log within the specified date range
Retrieve events from all logs that occurred between two specific dates
Find events within a specific date-time range in the System log
Retrieve events in the Application log within the specified date range
Retrieve events within the specified date and time range from the Application log
Last updated