Every logon, new account, service install and crash on Windows leaves a numbered event. You only need about thirty of those numbers to answer most “what happened on this box” questions. This Windows event IDs cheat sheet lists those IDs with their logon types and failure codes, plus the Get-WinEvent and wevtutil queries that pull them out of the Security and System logs.
We generated each event on purpose and read it back on Windows Server 2025 Datacenter (build 26100.33650) with Windows PowerShell 5.1 in November 2026. Two results surprised us. One filter returns a misleading “no events” error, and a default audit setting stops logging failures right when you need them.
Windows event IDs cheat sheet
Security log IDs come from the Microsoft-Windows-Security-Auditing provider and only appear when the matching audit subcategory is on. The exception is 1102, which the Microsoft-Windows-Eventlog provider writes. System log IDs come from the Service Control Manager, Microsoft-Windows-Eventlog, User32 and Kernel-Power providers and are always written. A row ending in †is from Microsoft’s event reference and was not generated on our lab VM; every other row was produced and read back there.
Logon and logoff (Security log)
| Event ID | What it records |
|---|---|
4624 | Successful logon, with logon type, account and source address |
4625 | Failed logon, with Status and SubStatus codes |
4634 | Logon session ended (logoff) †|
4647 | User started the logoff †|
4648 | Logon with explicit credentials, for example RUNAS †|
4672 | Special privileges assigned to a new logon (admin logon) †|
4740 | Account locked out after too many bad passwords |
Logon types in 4624 and 4625
| Type | Meaning |
|---|---|
2 | Interactive, at the console |
3 | Network, such as an SMB share or IPC$ |
4 | Batch, a scheduled task |
5 | Service started by the Service Control Manager |
7 | Unlock of a locked workstation |
8 | NetworkCleartext, password sent in clear text |
9 | NewCredentials, RUNAS /netonly |
10 | RemoteInteractive, Remote Desktop |
11 | CachedInteractive, cached domain credentials |
4625 failure codes (Status or SubStatus)
| Code | Reason |
|---|---|
0xC000006D | Bad user name or authentication info (the usual Status) |
0xC000006A | Correct user name, wrong password |
0xC0000064 | User name does not exist |
0xC0000224 | User must change password at next logon |
0xC0000234 | Account is locked out †|
0xC0000072 | Account is disabled †|
0xC0000193 | Account has expired †|
0xC0000071 | Password has expired †|
0xC000006F | Logon outside allowed hours †|
0xC0000070 | Logon from an unauthorized workstation †|
0xC000015B | Logon type not granted to this account †|
User and group changes (Security log)
| Event ID | What it records |
|---|---|
4720 | User account created |
4722 | User account enabled |
4723 | User tried to change their own password †|
4724 | Password reset by someone else (or set at creation) |
4725 | User account disabled |
4726 | User account deleted |
4738 | User account changed |
4767 | User account unlocked †|
4732 | Member added to a local security group |
4733 | Member removed from a local security group |
4728 / 4756 | Member added to a domain global / universal group (domain controllers only) †|
Processes, services and policy
| Event ID | What it records |
|---|---|
4688 | New process created (Security), command line if enabled |
4689 | Process exited (Security) †|
4697 | Service installed (Security, needs Security System Extension auditing) |
7045 | Service installed (System, Service Control Manager) |
7040 | Service start type changed (System) |
4719 | System audit policy changed †|
4616 | System time changed †|
Log tampering, boot and crash
| Event ID | What it records |
|---|---|
1102 | Security (audit) log cleared, in the Security log |
104 | Another log cleared, recorded in the System log |
1074 | Planned shutdown or restart: process, user and reason (User32) |
6006 | Event Log service stopped (clean shutdown) |
6005 | Event Log service started (boot) |
6009 | OS version and build at boot |
6013 | System uptime in seconds |
41 | Kernel-Power, Critical: rebooted without a clean shutdown |
6008 | Previous shutdown was unexpected, with its time |
Get-WinEvent queries
| Command | What it does |
|---|---|
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} -MaxEvents 20 | Latest 20 failed logons |
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4720,4726,4732; StartTime=(Get-Date).AddDays(-1)} | Account and group changes in the last day |
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624; Data='jdoe'} | Match any event data value (works in PowerShell 5.1) |
Get-WinEvent -LogName Security -FilterXPath "*[EventData[Data[@Name='TargetUserName']='jdoe']]" | Match one named field |
Get-WinEvent -FilterHashtable @{LogName='System'; Id=41,6008,1074} | Crashes and planned restarts |
Get-WinEvent -FilterHashtable @{LogName='System'; ProviderName='Service Control Manager'; Id=7045} | New services |
Get-WinEvent -Path C:\EventExports\security-logons.evtx | Read an exported .evtx file |
Get-WinEvent -ListLog Security,System,Application | Record count, size and mode of each log |
([xml]$e.ToXml()).Event.EventData.Data | Every named field of one event |
wevtutil commands
| Command | What it does |
|---|---|
wevtutil qe Security /q:"*[System[(EventID=4625)]]" /c:5 /rd:true /f:text | Newest 5 failed logons as text |
wevtutil qe Security /q:"*[System[(EventID=4625) and TimeCreated[timediff(@SystemTime) <= 3600000]]]" /f:text | Failed logons in the last hour |
wevtutil epl Security C:\EventExports\logons.evtx /q:"*[System[(EventID=4624 or EventID=4625)]]" | Export matching events to a file |
wevtutil cl Security /bu:C:\EventExports\security.evtx | Back up, then clear the log (logs 1102) |
wevtutil gl Security | Log settings: size, retention, access |
wevtutil sl Security /ms:1073741824 | Set the maximum log size to 1 GB |
wevtutil gli Security | File size and record count |
wevtutil el | List every log name |
All of these need an elevated PowerShell window. The Security log on our VM granted read access to SYSTEM, Administrators and the Event Log Readers group only. So if you want a monitoring account to read it without admin rights, add that account to Event Log Readers.
Which events does Windows Server 2025 log by default?
A fresh Windows Server 2025 install logs logons, failed logons, lockouts and account changes, but not process creation or service installs in the Security log. On our clone of the template, auditpol showed Logon at Success and Failure, User Account Management and Security Group Management at Success, and both Process Creation and Security System Extension at No Auditing. That means 4688 and 4697 never appear until you switch them on, while 7045 in the System log is always there.
Check your own baseline before you build any query on it. Your image or GPO may differ from ours.
auditpol /get /category:"Logon/Logoff","Account Management","Detailed Tracking","System"
To get process and service events, turn on the two subcategories and tell Windows to store the full command line in 4688. We also enabled Other Logon/Logoff Events for lock and unlock auditing. The registry value below is what the “Include command line in process creation events” policy writes. On domain members, a GPO with Advanced Audit Policy Configuration overwrites local auditpol changes at the next refresh, so set it there instead.
auditpol /set /subcategory:"Process Creation" /success:enable
auditpol /set /subcategory:"Security System Extension" /success:enable
auditpol /set /subcategory:"Other Logon/Logoff Events" /success:enable /failure:enable
New-Item -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit' -Force
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit' -Name ProcessCreationIncludeCmdLine_Enabled -Value 1 -PropertyType DWord -Force
The Audit key did not exist on our fresh template. If it already holds values on your server, drop -Force from New-Item, because on a registry key that switch deletes and recreates it. Then read the subcategories back. Each /set prints a one-line success message, and the /get confirms the change took.

Two more defaults matter for the rest of this sheet. Confirm both on your own server before you trust a query result.
net accountsshows the lockout threshold, which was 10 bad passwords in a 10 minute window on our VM.Get-WinEvent -ListLog Securityshows the log size, which was a 20 MB circular log on our VM.
At 20 MB, a busy file server can roll over its logon history in hours. Raise it with wevtutil sl, shown further down, before you depend on it.
How do you find failed logons with event ID 4625?
Query 4625 with Get-WinEvent and pull the account, logon type and SubStatus out of each event’s XML. The default Message column is a wall of text you cannot sort. This script turns the EventData fields into one hashtable per event and prints a table.
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} -MaxEvents 6 |
ForEach-Object {
$d = @{}
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]@{
Time = $_.TimeCreated.ToString('HH:mm:ss')
User = $d.TargetUserName
LogonType = $d.LogonType
Status = $d.Status
SubStatus = $d.SubStatus
Source = $d.IpAddress
}
} | Format-Table -AutoSize
We kept feeding wrong passwords for a local account called kiosk over net use \\127.0.0.1\IPC$ until we were past the lockout threshold of 10. The last attempt failed with “System error 1909 … The referenced account is currently locked out”, and the table shows the network logons (type 3) that came before it:

Status reads 0xc000006d on every row. SubStatus is the field that tells a wrong password apart from a user name that does not exist. Our probe for a fake “ghostuser” account produced 0xc0000064, while kiosk got 0xc000006a. So you should filter and group on SubStatus, never on Status alone.
Why the 4625 count is lower than the attempt count
Grouping every 4625 on the box by user and code exposed two gaps. Eleven looped attempts against kiosk plus one more after the lockout produced exactly ten events, one per bad password up to the threshold. None of the attempts after the 4740 lockout logged a 4625 with 0xC0000234. Three identical net use runs for jdoe produced one event, even though 4688 shows three separate net.exe processes.
Count Name
----- ----
10 kiosk, 0xc000006d, 0xc000006a
1 Administrator, 0xc0000224, 0x0
1 jdoe, 0xc000006d, 0xc000006a
1 ghostuser, 0xc000006d, 0xc0000064
The missing lockout failures almost certainly point to an audit policy gap rather than Windows behaviour. Microsoft’s Audit Account Lockout reference files a failed logon to an already locked account under that subcategory as 4625, a Failure event. The subcategory has no Success events, so our default Success setting logged nothing at all.
auditpol /set /subcategory:"Account Lockout" /failure:enable
We found the cause after the lab VM was gone, so we did not capture the after state. Even with it on, alert on 4740 for lockouts and treat 4625 as “at least this many” attempts, because the jdoe case shows repeated identical attempts can fold into one event. The Administrator row is the template’s first boot hitting “must change password” with 0xc0000224. New clones carry their own noise, so baseline them before you alert.
Which event IDs track user and group changes?
Local account changes land as 4720 through 4726 and 4740, and local group membership as 4732 and 4733. Creating, enabling, disabling and resetting a user also fire 4738 “user account was changed” events. We left 4738 out of the query below because it repeats the same story with less detail.
$since = (Get-Date).AddHours(-1)
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4720,4722,4724,4725,4726,4732,4733,4740; StartTime=$since; EndTime=(Get-Date)} |
Sort-Object TimeCreated |
ForEach-Object {
$d = @{}
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]@{
Time = $_.TimeCreated.ToString('HH:mm:ss')
Id = $_.Id
Event = ($_.Message -split "`r?`n")[0]
Target = $d.TargetUserName
By = $d.SubjectUserName
}
} | Format-Table -AutoSize
The jdoe rows are one New-LocalUser, two Add-LocalGroupMember calls, a Remove-LocalGroupMember, a password reset and a disable and enable round trip. For a 4732 or 4733 the Target column holds the group name, and the member sits in MemberSid. We trimmed two cloudbase-init password resets and the kiosk setup rows from the screenshot.

Look at 13:43:34. Our first New-LocalUser harrison failed with an InvalidPasswordException because the password contained the account name. Yet the log shows the account created, enabled and deleted in the same second. Windows creates the account, rejects the password and rolls back. So a 4720 followed at once by a 4726 is usually a failed create, not someone covering their tracks.
The By column shows the machine account because our commands ran as SYSTEM through the guest agent. Run them as an admin and you will see that admin’s name instead. We also added EndTime=(Get-Date) to the query. Two 4724 events written while the template was being built carry a timestamp later than the VM’s clock, and StartTime alone let them in. On a domain controller the domain group events are 4728 (global) and 4756 (universal) instead, and Microsoft’s events to monitor appendix lists the full domain set.
How do you see which programs and services started?
Process starts are event 4688 in the Security log. New services are 7045 in the System log plus 4697 in the Security log. With command-line logging on, 4688 shows exactly what ran, which is why incident responders ask for it first. Filter it on the command line text you care about.
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4688; StartTime=(Get-Date).AddMinutes(-15)} |
ForEach-Object {
$d = @{}
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]@{ Time=$_.TimeCreated.ToString('HH:mm:ss'); NewProcess=Split-Path $d.NewProcessName -Leaf; CommandLine=$d.CommandLine }
} | Where-Object { $_.CommandLine -match 'sc\.exe|whoami|-EncodedCommand ZwB|jdoe|ghostuser' } |
Sort-Object Time | Format-Table -AutoSize
Our run caught the net use probes, an encoded PowerShell command, a whoami /priv and the sc.exe calls for a test service. The three WrongPass1 rows for jdoe are the three processes behind that single 4625, and the sc.exe delete row sorts above the create only because all three share the same second. Stop and read the 13:44:53 row.

Command-line logging records passwords typed as arguments in plain text. Here it is the lab password on the last net use ... /user:jdoe row. Anyone in Event Log Readers can read it, and so can any SIEM that ingests 4688. Before you turn this setting on fleet-wide, check these points.
- No script, scheduled task or runbook passes a password as a command-line argument.
- Event Log Readers holds only the accounts that are allowed to see those command lines.
- The Security log is large enough for the extra volume, since our lab VM wrote 321 4688 events in about 20 minutes.
Most of those 321 events came from the guest agent’s own PowerShell calls. Expect your backup, monitoring and patching agents to be just as noisy.
7045 and 4697 for a new service
Persistence through a service shows up in both logs, but the two logs do not name it the same way. Query the System log for 7045, 7040 and 7036 filtered on the service name, and the Security log for 4697.
Get-WinEvent -FilterHashtable @{LogName='System'; Id=7045,7040,7036; StartTime=(Get-Date).AddMinutes(-20)} | Where-Object Message -match 'Updater' | Sort-Object TimeCreated | Format-List TimeCreated,Id,ProviderName,Message
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4697} -MaxEvents 1 | Format-List TimeCreated,Id,Message
Both fired for the same sc.exe create UpdaterSvc at 13:45:06. Compare the service name in each.

7045 shows the display name, “Updater Service”. 4697 shows the service key name, UpdaterSvc. So a search for one name misses the other event. Match on the Service File Name instead, because it is identical in both and a path under C:\ProgramData stands out there. 7045 needs no audit policy at all, which makes it the safer alert on servers where you do not control auditpol.
Why does Get-WinEvent say no events were found?
Get-WinEvent prints “No events were found that match the specified selection criteria” in two cases. The log may really have nothing, or your filter may be one PowerShell 5.1 cannot run. It gives no hint which, and on our VM the empty log was the least likely cause.
- A hashtable key named after an event field, such as
TargetUserName='jdoe', returns nothing in PowerShell 5.1 even though matching events exist. - An
Idlist of 24 values returns nothing, while the first 23 of the same IDs return 734 events. - A
StartTimenewer than the last matching event returns the same message, and this is the only case where the log really is empty.
The first two are easy to confirm side by side. The first pair compares a named-field key with the generic Data key, and $ids holds 24 Security event IDs from the tables above.
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624; TargetUserName='jdoe'} | Select TimeCreated,Id
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624; Data='jdoe'} | Select TimeCreated,Id,@{n='LogonType';e={$_.Properties[8].Value}}
$ids = 4624,4625,4634,4647,4648,4672,4688,4689,4697,4698,4699,4702,4719,4720,4722,4723,4724,4725,4726,4732,4733,4738,4740,4767
(Get-WinEvent -FilterHashtable @{LogName='Security'; Id=$ids} -ErrorAction Stop | Measure-Object).Count
(Get-WinEvent -FilterHashtable @{LogName='Security'; Id=$ids[0..22]} | Measure-Object).Count
The output shows the named-field filter failing and the generic Data key finding the same jdoe logon. Below that is the 24 versus 23 ID split.

The Get-WinEvent reference says an unknown hashtable key is treated as an event data name, but the explicit <named-data> key only appears on its PowerShell 7 pages. In our 5.1 test the named key matched nothing. In Windows PowerShell, use Data='value' to match any field holding that value, or switch to -FilterXPath for one named field. Split long ID lists into queries of 23 or fewer. Keep -ErrorAction Stop in scripts so an empty result throws instead of passing silently. Our PowerShell cheat sheet covers the pipeline and formatting cmdlets used in these queries.
How do you query and export logs with wevtutil?
wevtutil takes the same XPath as Event Viewer’s XML filter tab. It works in cmd.exe, Server Core and recovery shells where you may not want PowerShell. Memorise the timediff function, because it gives you “the last N milliseconds” without computing a timestamp.
wevtutil qe Security /q:"*[System[(EventID=4625) and TimeCreated[timediff(@SystemTime) <= 3600000]]]" /c:3 /rd:true /f:text | Select-String 'Date:','Account Name:','Sub Status:','Failure Reason:'
/rd:true returns newest first and /c:3 stops after three events. Each 4625 prints two Account Name lines, with the empty Subject first and the target account second.
Date: 2026-11-21T13:45:29.0270000Z
Account Name: -
Account Name: kiosk
Failure Reason: Unknown user name or bad password.
Sub Status: 0xC000006A
Date: 2026-11-21T13:45:26.9330000Z
Account Name: -
Account Name: kiosk
Failure Reason: Unknown user name or bad password.
Sub Status: 0xC000006A
Date: 2026-11-21T13:45:24.8270000Z
Account Name: -
Account Name: kiosk
Failure Reason: Unknown user name or bad password.
Sub Status: 0xC000006A
To hand evidence to someone else, export only the events that matter with epl and read the file back with Get-WinEvent. The export keeps the original records, so you can open the copy in Event Viewer on another machine.
New-Item -ItemType Directory C:\EventExports -Force
wevtutil epl Security C:\EventExports\security-logons.evtx /q:"*[System[(EventID=4624 or EventID=4625)]]"
Get-WinEvent -Path C:\EventExports\security-logons.evtx | Group-Object Id -NoElement
The export came to about 1.1 MB. It held both event types.
Name Count
---- -----
4624 192
4625 13
Then raise the Security log size, which on our VM was the 20 MB default. The value is in bytes, and wevtutil gl confirms it.
wevtutil sl Security /ms:1073741824
wevtutil gl Security | Select-String 'maxSize','retention'
The output shows the new 1 GB limit with retention still false. So the log keeps overwriting its oldest events instead of stopping when full.
retention: false
maxSize: 1073741824
A broken XPath fails loudly, which is better than Get-WinEvent’s misleading empty result. A missing closing bracket in /q:"*[System[EventID=4625]" printed “A syntax error occurred at position 22 … The specified query is invalid” and exited with code 15001, so a script can check $LASTEXITCODE.
What does event ID 1102 tell you?
Event 1102 means someone cleared the Security log. It is written as the first record of the new, empty log, so the clearing cannot erase its own trace. Clearing any other log writes 104 to the System log instead. We backed up and cleared Security, then cleared Application.
Run this on a lab or test VM only. Clearing a production log destroys evidence and fires the very alert this section recommends. Our Application clear had no backup, so add /bu: to it as well if anything in that log matters.
wevtutil cl Security /bu:C:\EventExports\security-before-clear.evtx
wevtutil cl Application
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=1102} | Format-List TimeCreated,Id,ProviderName,Message
Get-WinEvent -FilterHashtable @{LogName='System'; Id=104} -MaxEvents 1 | Format-List TimeCreated,Id,ProviderName,Message
Both events come from the Microsoft-Windows-Eventlog provider, not the auditing provider. That is why 1102 is logged even if every audit subcategory is off.

The Subject block names who cleared it, which is SYSTEM here because of the guest agent. On a real server, a 1102 outside a maintenance window deserves an alert of its own. Forwarding the Security log to a collector is the only way to keep what was erased. If that is where you are heading, the SIEM books for Wazuh, Splunk and Elastic are a good place to plan the collection side.
How do you tell a clean reboot from a crash?
A clean restart writes 1074 (who asked and why) followed by 6006, while a crash or power loss writes Kernel-Power 41 and 6008 on the next boot with no 6006 before them. Use this list to read the System log after any restart.
- A 1074 names the process, the user and the reason code for a planned restart.
- A 6006 before the next 6005 confirms the Event Log service stopped cleanly.
- A Critical 41 followed by a 6008 confirms the previous shutdown was not clean.
- Both kinds of boot end with 6009, 6005 and 6013, so those three alone prove nothing.
We tested both paths. We restarted the VM with shutdown /r /t 5 /c "Rename to DEVBOX" /d p:2:4, then pulled the virtual power cord with a hypervisor reset.
Get-WinEvent -FilterHashtable @{LogName='System'; Id=41,1074,6005,6006,6008,6009,6013; StartTime=(Get-Date).AddMinutes(-30); EndTime=(Get-Date)} |
Sort-Object TimeCreated |
Select-Object @{n='Time';e={$_.TimeCreated.ToString('HH:mm:ss')}}, Id, LevelDisplayName, ProviderName, @{n='Message';e={($_.Message -split "`r?`n")[0]}} |
Format-Table -AutoSize -Wrap
The first five rows are the template’s own first-boot restart. The two boots we caused tell different stories. The reason code from /d p:2:4 comes back as “Operating System: Reconfiguration (Planned)” in the 1074 event.

The 6008 message names the last time Windows was known to be running, 2:04:32 PM. That is close to when the failure happened, not when someone noticed it. Event 41’s data fields tell you more. Microsoft’s Kernel-Power 41 guide explains that a zero BugcheckCode points to power loss or a hang rather than a blue screen. Read the fields like this.
$e = Get-WinEvent -FilterHashtable @{LogName='System'; Id=41} -MaxEvents 1
([xml]$e.ToXml()).Event.EventData.Data | Select-Object -First 6 Name,'#text'
Our hard reset left every bugcheck field at zero. A blue screen would have put its stop code in the first row.
Name #text
---- -----
BugcheckCode 0
BugcheckParameter1 0x0
BugcheckParameter2 0x0
BugcheckParameter3 0x0
BugcheckParameter4 0x0
SleepInProgress 0
If you also run Linux hosts and want the same kind of printable reference for their packet filter, our firewalld cheat sheet covers firewall-cmd zones, ports, rich rules and port forwarding, tested on Ubuntu and Rocky Linux. For the Windows side of remote access, the guides to OpenSSH Server on Windows Server and NTLM and Kerberos on Windows Server 2025 explain the logons behind many 4624 type 3 events.
What should you check on a new server’s event logs?
Six checks make sure the IDs above are there when you need them. Work through them in order, since the later ones depend on the audit policy from the first.
auditpol /get /subcategory:"Process Creation","Security System Extension","Account Lockout"reports Success for the first two and Success and Failure for Account Lockout.- A test command such as
whoami /privappears in a 4688 event with its full command line. wevtutil gl Securityshows a maxSize larger than the 20 MB default.net accountsshows the lockout threshold you expect, so 4740 fires when it should.- Your monitoring account is a member of Event Log Readers, which the Security log’s access list grants read, and can run the 4625 query without admin rights.
- Every saved query that lists event IDs uses 23 IDs or fewer per hashtable.
Once all six pass, rotate the local admin password with Windows LAPS, since a rotated password turns any later 4624 for that account into something worth reading. And when you need a console fast while chasing an event, the Windows Run commands cheat sheet gets you to eventvwr.msc, services.msc and lusrmgr.msc in one keystroke.