Monitoring Windows Event IDs for Unsuccessful Logins, Unlocks, and Startups in Windows 11

Abstract: Track Windows 11 Event IDs 4625, 4740, and 6005 to detect brute-force attacks, account lockouts, and verify system boot integrity.

Created: 2026-10-04 by
Monitoring Windows Event IDs for security and system health requires tracking specific numeric codes in the Security log. Successful monitoring of unsuccessful logins, account unlocks, and system startups allows administrators to detect brute-force attacks, identify locked-out accounts, and verify boot integrity. This guide details the precise Event IDs for Windows 11 and provides automated PowerShell methods to extract these critical logs efficiently.

Understanding Critical Event IDs

Windows uses a structured logging system where every significant action is assigned a unique Event ID. To effectively monitor your system, you must understand which IDs correspond to the events you wish to track. The Security log within the Windows Event Viewer is the primary repository for these records. For unsuccessful login attempts, the most critical identifier is Event ID 4625. This event is generated whenever a user or service fails to authenticate against the local machine or a domain controller. Monitoring this ID helps identify potential brute-force attacks or misconfigured services attempting to access resources with invalid credentials. Each instance provides valuable data such as the source IP address, the target username, and the specific failure reason code. When an account becomes locked due to too many failed attempts, Windows generates Event ID 4740. This "Account Lockout" event is crucial for security teams because it indicates that an automated script or malicious actor has triggered the lockout policy. By tracking this ID, administrators can quickly identify the source of the lockout request and determine if it stems from a legitimate user error or a targeted attack. System startup events are tracked differently than security events. Event ID 6005 indicates that the Event Log service was started, which typically happens during a normal system boot. Conversely, Event ID 6006 signifies a clean shutdown. While these do not indicate errors, they are essential for verifying that the system has started correctly after maintenance windows or unexpected power losses. For more advanced monitoring techniques, you might also want to explore Monitoring Windows Event IDs for Unsuccessful Logins, Unlocks, and Startups in Windows 11 for deeper context on log aggregation strategies.

Enabling and Accessing the Security Log

Before you can monitor these events, you must ensure that auditing policies are enabled and that you have access to the Security log. In Windows 11, the Security log is not always populated by default for all actions unless specific Group Policy settings are configured. First, open the Local Group Policy Editor by searching for "gpedit.msc" in the Start menu. Navigate to Computer Configuration > Windows Settings > Security Settings > Advanced Audit Policy Configuration > Audit Policies > Logon/Logoff. Here, you should enable both "Audit Logon" and "Audit Other Logon/Logoff Events." This ensures that the system records detailed information about authentication attempts, including failures. Once auditing is enabled, you can view the logs by opening the Event Viewer application. Expand the "Windows Logs" section in the left-hand pane and select "Security." You may need administrative privileges to view certain entries. If the log appears empty, verify that the auditing policy was applied successfully by running gpresult /r in the command prompt to check current group policy assignments.

Automating Monitoring with PowerShell

Manually checking the Event Viewer for specific IDs is inefficient for large-scale monitoring. PowerShell provides a robust way to query these logs programmatically. You can use the Get-WinEvent cmdlet to filter events based on their ID and time range. To retrieve recent unsuccessful login attempts, use the following command structure:
Get-WinEvent -FilterHashtable @{
    LogName = 'Security'
    ID = 4625
    StartTime = (Get-Date).AddDays(-1)
} | Select-Object TimeCreated, Message
This command filters the Security log for Event ID 4625 occurring within the last 24 hours. The output displays the timestamp and the detailed message, which includes the username and source IP. For account lockouts, simply replace the ID with 4740. To monitor startups, query Event ID 6005 in the System log instead of the Security log by changing the LogName parameter to 'System'. You can export these results to a CSV file for further analysis using the Export-Csv cmdlet. This approach allows you to integrate log monitoring into existing IT workflows or alerting systems without relying solely on the graphical interface.

Interpreting Results and Taking Action

Once you have retrieved the relevant events, interpreting them correctly is key to maintaining security. For Event ID 4625, pay attention to the "Failure Code" field. Codes like 0xC000006D indicate invalid usernames or passwords, while 0xC000006E suggests the account does not exist. High volumes of 0xC000006D errors from a single IP address strongly suggest a password spraying attack. For Event ID 4740, identify the "Caller Computer Name" to determine which machine initiated the lockout. This could be a compromised workstation or a server with a stale credential cache. Immediate investigation is required to prevent further disruption or data loss. Startup events like 6005 should be correlated with scheduled maintenance or patching windows. If a 6005 event appears at an unexpected time, it may indicate unauthorized reboots or system instability. Regularly reviewing these logs ensures that your Windows 11 environment remains secure and stable. For related troubleshooting on system performance, consider reading about Scheduling a Task to Start a Batch File with Windows Task Scheduler to automate routine checks.

Frequently Asked Questions

How do I find the Security log if it is hidden?

The Security log is usually visible by default in Event Viewer, but if it is missing, ensure that the Windows Event Log service is running. Restarting the service via Services.msc often restores visibility to the log entries.

Can I receive email alerts for Event ID 4625?

Yes, you can create a custom subscription in Event Viewer that triggers a task when a specific event occurs. This task can execute a PowerShell script that sends an email notification using the Send-MailMessage cmdlet.

What is the difference between Event ID 4625 and 4771?

Event ID 4625 logs general logon failures across various protocols, while 4771 specifically logs Kerberos pre-authentication failures. Both indicate authentication issues, but 4771 is more specific to domain environments using Kerberos.

Why are my startup events missing from the log?

If Event ID 6005 is missing, check if the Event Log service was stopped before the shutdown occurred. Additionally, ensure that no third-party software is interfering with the standard logging process or clearing logs prematurely.

Is it safe to delete old security events manually?

Deleting events manually is generally discouraged as it removes audit trails required for compliance. Instead, configure log retention policies in Group Policy to automatically archive or overwrite old events after a set period.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More