How to Enable Windows Audit Logging
Most of the event IDs on this site are not recorded until auditing is switched on. Windows ships with a minimal default policy, so before you can hunt in the Security log you have to enable the right subcategories, and for process and PowerShell visibility you need a few extra settings. This primer covers the four sources worth configuring first.
1. Advanced Audit Policy Configuration
The Security log is driven by the Advanced Audit Policy, not the legacy nine audit categories. Configure it per machine with auditpol or, at scale, through Group Policy under Computer Configuration → Policies → Windows Settings → Security Settings → Advanced Audit Policy Configuration. Enforce it with the setting Audit: Force audit policy subcategory settings to override audit policy category settings so the advanced policy actually wins.
The subcategories with the highest return for detection are Logon and Logoff (4624, 4625, 4634), Special Logon (4672), User Account Management and Security Group Management (4720, 4728, 4732, 4740), Kerberos authentication and service tickets (4768, 4769, 4771) and Security System Extension for service installs (4697). To check what is live on a host, run auditpol /get /category:*.
Audit the log's own integrity too: Audit Log Clear produces 1102 whenever the Security log is wiped, a classic anti-forensics step. Finally, size the logs generously — the default Security log is far too small to retain a useful window on a busy server — and forward them off-host (WEF or an agent) so an attacker who clears a log cannot erase your copy.
2. Command-line process auditing
Process creation (4688) is enabled through the Audit Process Creation subcategory, but by default it does not record the command line. Turn on Administrative Templates → System → Audit Process Creation → Include command line in process creation events to capture the arguments — which is where encoded PowerShell, living-off-the-land binaries and tool flags show up. Sysmon event 1 captures the same data plus hashes and the parent command line, and is often run alongside 4688.
3. PowerShell logging
PowerShell deserves its own treatment because attackers lean on it so heavily. Enable Script Block Logging to record the deobfuscated code that runs (4104), and consider Module Logging for pipeline detail and Transcription for a plain-text record of sessions. Script block logging is the single highest-value PowerShell setting for detection, and it captures malicious code even when it is obfuscated or built at runtime.
4. Sysmon
System Monitor (Sysmon) adds endpoint telemetry the native logs lack: process creation with hashes, network connections (3), image loads (7), remote-thread injection (8), process access (10), file creation (11) and registry changes (13). Sysmon is only as good as its configuration: start from a well-maintained community baseline, tune out your environment's noise, and keep the config under version control. Every record is correlated by a per-process GUID, which lets you reconstruct an entire process tree.
Where to go next
Once auditing is on, browse the full event ID index or jump to a detection use case to see which IDs answer the question you are investigating.