Event ID 4625: how to spot RDP brute-force attempts on Windows Server
Every failed Windows sign-in leaves an Event ID 4625 in the Security log. Here is how to read one, why Remote Desktop failures often show logon type 3, and how to count them per IP address to see whether someone is guessing your passwords.
Key takeaways
- Event ID 4625 means a sign-in failed. Windows writes it to the Security log with the account tried, the logon type, a status code and, usually, the source address.
- With Network Level Authentication on, a failed Remote Desktop sign-in usually shows as logon type 3, not 10. Filter on 4625 alone, never on 4625 plus type 10.
- 0xC000006A is a wrong password; 0xC0000064 is a user name that does not exist. Hundreds of them from a few addresses mean someone is guessing.
- Count failures per address with Get-WinEvent, then limit Remote Desktop to your own IP addresses and set an account lockout policy, minding the built-in Administrator exception.
On this page
- What is Event ID 4625?
- Where do I see failed Remote Desktop sign-ins in Event Viewer?
- Is Remote Desktop logon type 10 or 3?
- What do the 4625 status codes mean?
- How do I count failed sign-ins by IP address with PowerShell?
- Which other events matter: 4624, 4740, 4776 and 1149?
- Is my server under a brute-force attack? Signs to look for
- What should I do next?
- Should I do this myself or have it done?
What is Event ID 4625?
Event ID 4625, "An account failed to log on", is the entry Windows writes to its Security log every time a sign-in fails. On a server that accepts Remote Desktop (RDP) from the internet, hundreds or thousands of 4625 events from a handful of addresses, aimed at Administrator or at user names that do not exist, are the usual sign of a brute-force attack: software guessing passwords. Each event records the account that was tried, the logon type, a status code that says why it failed and, usually, the address the attempt came from.
Microsoft files the event under the Audit Logon and Audit Account Lockout subcategories, and it is written on the computer where the sign-in was attempted: on a VPS, the server itself. Every step below needs Administrator access, which you have on any RyzenRDP Windows VPS.
Where do I see failed Remote Desktop sign-ins in Event Viewer?
- On the server, open Event Viewer (
eventvwr.msc). - Go to Windows Logs > Security.
- Select Filter Current Log and enter
4625(or4624, 4625for successes too). - Open an event and read Logon Type, Failure Information (Status and Sub Status) and Source Network Address.
The Remote Desktop side is under Applications and Services Logs > Microsoft > Windows: TerminalServices-RemoteConnectionManager > Operational (event 1149) and RemoteDesktopServices-RdpCoreTS > Operational (event 131).
Is failure auditing on? Microsoft lists the Windows Server default for Audit Logon as Success and Failure, so a server logs failed sign-ins as 4625 unless a policy turned it off. Check it as Administrator, and turn both on if either is missing:
auditpol /get /subcategory:"Logon"
auditpol /set /subcategory:"Logon" /success:enable /failure:enable
Failed sign-ins to an account that is already locked out (status 0xC0000234) are logged by a second subcategory,
Audit Account Lockout. Microsoft lists its failure auditing as off by default on Windows Server, and its Audit Account
Lockout page recommends turning it on for member servers. Turn it on too:
auditpol /set /subcategory:"Account Lockout" /failure:enable
Is Remote Desktop logon type 10 or 3?
Both, depending on when the password is checked. Microsoft's logon types and what each means on a server (types 0, 12 and 13 are listed in Microsoft's 4624 reference, the others in both the 4624 and 4625 references):
| Logon type | Microsoft's name | What it means on a server |
|---|---|---|
| 0 | System | Used only by the System account, for example when Windows starts |
| 2 | Interactive | A sign-in at the server's own screen; on a VPS, your provider's console |
| 3 | Network | Access from the network, such as a file share, and the password check that Network Level Authentication runs before a Remote Desktop session |
| 4 | Batch | A process running for a user without the user's direct involvement |
| 5 | Service | A service started by the Service Control Manager under its account |
| 7 | Unlock | A locked session was unlocked |
| 8 | NetworkCleartext | A sign-in from the network where the password reached the authentication package unhashed |
| 9 | NewCredentials | A process copied its current sign-in and uses other credentials for its outgoing network connections |
| 10 | RemoteInteractive | "A user logged on to this computer remotely using Terminal Services or Remote Desktop" |
| 11 | CachedInteractive | A sign-in with domain credentials stored on the computer |
| 12 | CachedRemoteInteractive | "Same as RemoteInteractive"; Microsoft says it is used for internal auditing |
| 13 | CachedUnlock | Microsoft's 4624 page describes it only as "Workstation logon" |
A successful Remote Desktop sign-in ends as event 4624 with logon type 10. A failed one usually does not. With Network Level Authentication (NLA) on, the client proves the password before the session starts, so a wrong password is logged as 4625 with logon type 3. Microsoft's reference pages do not spell this out; Sophos's incident responders and EventSentry document it, and Microsoft's archived TechNet Wiki trace of an NLA connection shows the order: a type 3 sign-in, then event 1149, then type 10 once the desktop starts. EventSentry notes that failed RDP sign-ins were logged as type 10 before NLA, and that whether NLA is on decides which kind of 4625 Windows writes: with NLA off, expect type 10. See our Network Level Authentication guide.
The practical rule: filter on Event ID 4625 alone, never on 4625 plus logon type 10, or you miss most failed Remote Desktop sign-ins. Type 3 failures can also come from file sharing (SMB) if port 445 is open to the internet.
Why is the source address sometimes empty?
Some type 3 failures show a hyphen (-) in Source Network Address. Microsoft's 4624 page explains that these
fields depend on the authentication protocol, and that NTLM sign-ins carry no TCP/IP details. Event 131 in the
RdpCoreTS log still records the address and port of every connection, signed in or not; match it by time.
Workstation Name comes from the client, so treat it as a hint, not proof.
What do the 4625 status codes mean?
Read both Status and Sub Status under Failure Information. When the Status is the general 0xC000006D, the
Sub Status usually says whether the user name or the password was wrong.
| Code | Meaning (Microsoft's 4625 page) | What it usually means for RDP |
|---|---|---|
0xC000006A |
"User logon with misspelled or bad password" | Right account, wrong password. A long run against Administrator is password guessing |
0xC0000064 |
"User logon with misspelled or bad user account" | The user name does not exist. Microsoft notes that several in a row can be a user enumeration attack |
0xC000006D |
"This is either due to a bad username or authentication information" | A general failure: read the Sub Status |
0xC0000234 |
"Account locked out" (the failure reason it gives for this code) | Your lockout policy has kicked in |
0xC0000072 |
"User logon to account disabled by administrator" | Someone is trying an account you turned off, such as Guest |
0xC000015B |
"The user has not been granted the requested logon type (aka logon right) at this machine" | The account may not sign in this way, for example over Remote Desktop |
How do I count failed sign-ins by IP address with PowerShell?
Run PowerShell as Administrator (Microsoft's Get-WinEvent reference warns that otherwise a log may be unreadable). This collects the last 24 hours of 4625 events and reads each event's named fields from its XML:
$failed = Get-WinEvent -FilterHashtable @{
LogName = 'Security'
Id = 4625
StartTime = (Get-Date).AddDays(-1)
} | ForEach-Object {
$data = @{}
foreach ($d in ([xml]$_.ToXml()).Event.EventData.Data) {
$data[$d.GetAttribute('Name')] = $d.InnerText
}
[pscustomobject]@{
Time = $_.TimeCreated
Address = $data['IpAddress']
Account = $data['TargetUserName']
LogonType = $data['LogonType']
SubStatus = $data['SubStatus']
}
}
Count the failures per address, then per account name to see which user names are being guessed:
$failed | Group-Object -Property Address -NoElement |
Sort-Object -Property Count -Descending | Select-Object -First 20
$failed | Group-Object -Property Account -NoElement |
Sort-Object -Property Count -Descending | Select-Object -First 20
- The filter keys and the
Group-ObjectandSort-Objectsteps follow Microsoft's Get-WinEvent examples. Filtering onIpAddressdirectly needs PowerShell 6 or later, so the script reads the XML and runs in the Windows PowerShell 5.1 that comes with Windows Server. - A
-in the Address column is the empty source address described above. On a very large log, add-MaxEvents 5000after the hash table.
Which other events matter: 4624, 4740, 4776 and 1149?
| Event | Where it is logged | What it tells you |
|---|---|---|
| 4624 | Security log | A successful sign-in; type 10 is a Remote Desktop session. Compare its address with the addresses that failed |
| 4740 | Security log | An account was locked out. Its Caller Computer Name is a computer name, not an IP address |
| 4776 | Security log | An NTLM password check, logged where the account lives: the server for local accounts, the domain controller for domain accounts. Its policy, Audit Credential Validation, is off by default on Windows Server |
| 4771 | Security log, domain controllers only | Kerberos pre-authentication failed; failure code 0x18 is a wrong password |
| 1149 | TerminalServices-RemoteConnectionManager > Operational | "User authentication succeeded", with the user and the source address. It marks a password that passed, not a finished sign-in |
| 131 | RemoteDesktopServices-RdpCoreTS > Operational | A new TCP or UDP connection and the client's address and port, whether or not anyone signs in |
Microsoft's audit recommendations add a habit worth keeping: learn your server's normal rate of failed sign-ins and treat anything well above it as possible password guessing.
Is my server under a brute-force attack? Signs to look for
Any server with Remote Desktop open to the whole internet receives password guesses. The questions are how many, and whether any of them worked.
- Volume: hundreds or thousands of 4625 events a day, often in bursts.
- A few addresses at the top of the per-address count, or many addresses trying a few times each.
- User names you never created, such as admin, user or test, with Sub Status
0xC0000064: user enumeration. 0xC000006Aagainst Administrator: someone is guessing the real account's password.- 4740 lockouts you did not cause, or failures with
0xC0000234. - The one that matters most: a 4624 success from an address that also appears among the failures, or at an hour you were not working. Treat it as a possible break-in: sign in from your provider's console, change the passwords, and look for accounts, scheduled tasks and programs you did not add.
What should I do next?
-
Limit Remote Desktop to your own IP addresses, so guesses from other addresses never reach the sign-in. Microsoft's troubleshooting guide selects the built-in rules with
Get-NetFirewallRule -DisplayGroup "Remote Desktop", and Set-NetFirewallRule's-RemoteAddressparameter limits who they allow. Replace 198.51.100.7, an example address, with your own public IP address; separate several with commas. Keep your current session open while you test from a new one:Get-NetFirewallRule -DisplayGroup "Remote Desktop" | Set-NetFirewallRule -RemoteAddress 198.51.100.7This works only while the Windows firewall is on. Run
Get-NetFirewallProfile -PolicyStore ActiveStore(the settings in force) and check that Enabled is True and DefaultInboundAction is not Allow for each profile: with the firewall off, or with Allow, every address still gets through. Any other rule that allows the port, such as one for a moved port, still lets every address in: limit it too. -
Set an account lockout policy in Local Security Policy, under Account Policies > Account Lockout Policy. Check the values your server already has before you change them. Microsoft's Account lockout threshold page gives 0 (never locks) as the stand-alone server default, which is what a server set up before the October 2022 updates has. KB5020282 says that on a computer set up with the October 11, 2022 or later updates already installed, these settings are set by default at setup; its baseline is 10 failed attempts within 10 minutes, then a 10-minute lockout, and Microsoft's security baselines suggest a threshold of 10. The Account lockout threshold page also says the built-in Administrator account is excluded. The same updates add Allow Administrator account lockout, which covers it for network sign-ins such as Remote Desktop while console sign-ins still work. Anyone who knows an account name can then lock it on purpose, one more reason to limit Remote Desktop to your addresses.
-
Keep Network Level Authentication on and use a long, unique password for every account that may sign in over Remote Desktop. Remove accounts nobody uses.
-
Do not count on a new port. Moving Remote Desktop off 3389 cuts the noise in your logs, not the risk: see the RDP port 3389 guide.
-
Automatic blocking tools, such as IPBan (open source, MIT license, with a paid Pro edition) and RdpGuard (paid, with a 30-day trial), read the same failed sign-in events and block addresses that fail too often. Like the count above, they depend on the address Windows records.
Our RDP hardening checklist puts every setting in order.
Should I do this myself or have it done?
Everything in this guide can be done by hand. If you would rather have it done once, with a record of what changed:
- RDP Security Check (free): a PowerShell script you run on your own Windows server as Administrator. It reads your Remote Desktop settings, changes nothing and lists what leaves room for brute-force sign-ins. Nothing is scanned from outside. The RDP Lockdown page says how to get it.
- RDP Lockdown Standard ($79 one-off): we turn on Network Level Authentication, TLS and high encryption for Remote Desktop, an account lockout policy and sign-in auditing, turn SMBv1 off, check Defender and the firewall, review the local administrators and, if you want it, limit Remote Desktop to the IP addresses you name. You get a before-and-after report of every setting. It covers Windows Server 2019, 2022 and 2025, on a RyzenRDP server or at another provider where you can open the server's console.
- RDP Lockdown Plus ($149 one-off): Standard plus two-step sign-in on an MFA account of your own, set up in a session with you.
If you see signs of a break-in, such as a successful sign-in from an address you do not know, RDP Lockdown is not the fix: we stop a Lockdown job on a server that shows signs of compromise, and investigating a compromise is not part of any of our services.
RDP Lockdown reduces the risk of brute-force sign-ins; it cannot make any server impossible to break into, so keep Windows updated and keep copies of your important data elsewhere. For a Windows Server 2016 server, see the server move instead.
FAQ
Does Windows Server log failed RDP sign-ins by default?
Yes. Microsoft lists the Windows Server default for Audit Logon as Success and Failure, so failed sign-ins are written to the Security log as Event ID 4625. A Group Policy can change that; run auditpol /get /subcategory:"Logon" as Administrator to check. Failed sign-ins to an account that is already locked out belong to Audit Account Lockout, which Microsoft lists as off for failures by default on Windows Server; auditpol /set /subcategory:"Account Lockout" /failure:enable turns it on.
Why is the source IP address empty in Event ID 4625?
The address fields depend on the authentication protocol, and Microsoft notes that NTLM sign-ins carry no TCP/IP details. With Network Level Authentication, the password is checked in a network (type 3) sign-in before the session starts. When Source Network Address shows a hyphen, event 131 in the RemoteDesktopServices-RdpCoreTS Operational log still records the address and port of each connection; match the two by time.
What is the difference between Event ID 4624 and 4625?
Event ID 4624 means an account signed in; Event ID 4625 means a sign-in failed. Both come from the Audit Logon policy and carry the same logon types. A 4624 from an address that also produced many 4625 events is the first thing to investigate.
What is logon type 3 versus logon type 10?
Logon type 3 (Network) is access from the network, such as a file share. Logon type 10 (RemoteInteractive) is a Remote Desktop session. With Network Level Authentication on, the password is checked in a type 3 sign-in first, so failed RDP sign-ins usually appear as 4625 with logon type 3.
Does changing the RDP port stop brute-force attacks?
No. A different port cuts the automated noise aimed at port 3389, but a port scan finds the new one. Limiting Remote Desktop to your own IP addresses, an account lockout policy, Network Level Authentication and long, unique passwords do more.
Does an account lockout policy protect the Administrator account?
Not on its own. Microsoft's Account lockout threshold page says the built-in Administrator account is excluded. Windows updates since October 2022 add Allow Administrator account lockout (KB5020282), which covers it for network sign-ins such as Remote Desktop while console sign-ins still work. It is on by default only where Windows was installed with those updates already in place, so check it.
Can you check my server's RDP settings for me?
Not from outside: you run the check yourself. RyzenRDP's free RDP Security Check is a PowerShell script you run on your own Windows server: it reads the Remote Desktop settings, changes nothing and lists what leaves room for brute-force sign-ins. To have the changes made, RDP Lockdown Standard is $79 one-off for Windows Server 2019, 2022 or 2025, at RyzenRDP or another provider, with a before-and-after report.
Sources
- Microsoft Learn: 4625(F) An account failed to log on (logon types, Status and Sub Status codes, Source Network Address)
- Microsoft Learn: 4624(S) An account was successfully logged on (logon types; the address fields depend on the protocol)
- Microsoft Learn: Audit logon events and Audit Logon; Audit Account Lockout (failed sign-ins to a locked-out account; Failure auditing recommended on member servers)
- Microsoft Learn: System Audit Policy recommendations (Windows Server defaults)
- Microsoft Learn: 4740(S) A user account was locked out, 4776(S, F) The computer attempted to validate the credentials for an account and 4771(F) Kerberos pre-authentication failed
- Microsoft Learn: Get-WinEvent and Creating Get-WinEvent queries with FilterHashtable
- Microsoft Learn: auditpol get and auditpol set
- Microsoft Learn: Account lockout threshold (built-in Administrator excluded)
- Microsoft Support: KB5020282: Account lockout available for built-in local administrators
- Microsoft Learn: Remote Desktop can't connect to the remote computer (the Remote Desktop firewall rule group), Set-NetFirewallRule (-RemoteAddress), Get-NetFirewallProfile and Set-NetFirewallProfile (Enabled and DefaultInboundAction)
- Microsoft Learn (archived TechNet Wiki): RDP Direct Connection with NLA RDS Session Host Event Logs (the order of events 131, 4624, 1149 and 21)
- Sophos X-Ops blog: "Remote Desktop Protocol: Queries for Investigation" by Lee Kirkpatrick (failed RDP sign-ins with NLA log as logon type 3)
- EventSentry blog: "RDProtector: automatically blocking malicious IPs from RDP", 22 July 2019 (logon type 10 before NLA, type 3 with NLA, RdpCoreTS event 131)
- IPBan: DigitalRuby/IPBan on GitHub (MIT license)
All pages read on 14 November 2026.