CoCoineticBack to coinetic.io

Event ID 4624: an account was successfully logged on

Event 4624 is written in the Security log every time an account logs on successfully: at the keyboard, over the network, by Remote Desktop, as a service. On a Server that is thousands a day. Most are harmless – the art is to find the few that are not, such as a Remote Desktop logon from an address you do not know, right after a series of failed logons (4625).

In short
  • What it is: a successful logon. Its partner for failures is Event 4625; the matching logoff is 4634 / 4647.
  • The key field is the logon type: 10 = Remote Desktop, 3 = network (file shares, and the first step of every RDP logon with NLA), 2 = at the keyboard, 5 = service.
  • Where from: the fields Source Network Address and Workstation Name.
  • Worth a closer look: type 10 or 3 from an internet address, logons at unusual times, a new account, or a success right after many failures from the same address.

1. Where to find it

Event Viewer (eventvwr.msc) › Windows Logs › Security, filter for 4624. Windows writes it by default (audit subcategory Logon, Success). On a domain controller you see the logons at the domain controller – a user's logon at their own PC is logged on that PC.

2. The logon types

TypeNameWhat it means
2InteractiveAt the keyboard (or a console session in Hyper-V / VMware).
3NetworkAccess over the network: file shares, printers, remote management. With Network Level Authentication every RDP logon starts with a type 3.
4BatchA scheduled task.
5ServiceA service started under an account.
7UnlockThe screen was unlocked (also a reconnect to a locked RDP session).
8NetworkCleartextThe password went over the network in clear text, e.g. IIS Basic authentication. Should be rare.
9NewCredentialsrunas /netonly: other credentials for network access only.
10RemoteInteractiveRemote Desktop.
11CachedInteractiveLogon with cached domain credentials, no domain controller reachable (laptops).

3. The fields that matter

4. PowerShell: who logged on by Remote Desktop, and from where

As administrator. The helper reads the fields by name, so it works on every Windows language:

function Get-EventFields($e) { $d = [ordered]@{}; ([xml]$e.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }; [pscustomobject]$d }
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624; StartTime=(Get-Date).AddDays(-7)} -ErrorAction SilentlyContinue |
  ForEach-Object { $f = Get-EventFields $_; if ($f.LogonType -eq '10') {
    [pscustomobject]@{ Time = $_.TimeCreated; User = "$($f.TargetDomainName)\$($f.TargetUserName)"; From = $f.IpAddress; Computer = $f.WorkstationName } } } |
  Format-Table -AutoSize

Change '10' to '3' for network logons. Logons from internet addresses, grouped:

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624; StartTime=(Get-Date).AddDays(-7)} -ErrorAction SilentlyContinue |
  ForEach-Object { Get-EventFields $_ } |
  Where-Object { $_.IpAddress -match '^\d' -and $_.IpAddress -notmatch '^(10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.|127\.)' } |
  Group-Object IpAddress, TargetUserName, LogonType | Sort-Object Count -Descending | Select-Object Count, Name

5. Which successful logons should worry you

What to do: if the logon was not yours, end the session (query session, logoff <id>), change the account's password, block the address in the firewall and check what happened in the session (new accounts, new services – Event 7045, scheduled tasks – Event 4698).

6. Let Coinetic watch it for you

Coinetic watches the logon side of the Security log for you:

Protect this Server or PC in 5 minutes

Download Coinetic, install, done: it starts protecting at once. 30 days free with all features, no payment details. From $20 per computer per year.

Start the free 30-day trial →

More guides: all Coinetic guides.

Frequently asked

Why do I see a type 3 logon before every RDP logon?

With Network Level Authentication the client authenticates first over the network (type 3), then the desktop session starts (type 10, or 7 when you reconnect to a locked session). Both belong to the same Remote Desktop logon.

What is the difference between 4624 and 4625?

4624 is a successful logon, 4625 a failed one. Many 4625 from one address followed by a 4624 from the same address is the pattern of a guessed password.

Why are there so many 4624 entries with ANONYMOUS LOGON or SYSTEM?

Windows itself logs on constantly: services, the computer account, anonymous network queries. Filter them out and look at real user accounts and at the logon types 10 and 3 from outside.

Can I switch off Event 4624 to reduce noise?

Better not: it is the record of who got in. If the log is too noisy, make it bigger and filter when you read it.