1. Resources
  2. Detection sources
  3. Event ID 4740

Event ID 4740: A user account was locked out

Written when failed logon attempts lock an account out: for domain accounts on domain controllers, for local accounts on member servers and workstations. Names the computer the failed attempts came from.

Log source
Windows Security log
Detection value
Supporting
Volume
Low
Last updated
Audit subcategory
Audit User Account Management (Account Management, Success)
Logged on
All Windows computers
Event versions
0
Detects
1 attack (1 rule)
MITRE ATT&CK
1 technique in 1 tactic
Threat groups
4 groups that MITRE ATT&CK records using these techniques
Fields the rules read
The event ID and the provider only

When it is written

Windows writes 4740 when an account is locked out because its failed logon attempts reached the Account lockout threshold. Domain controllers write it for domain accounts, member servers and workstations for their local accounts. Microsoft lists it as a success event of Audit User Account Management, not of Audit Account Lockout: that subcategory only covers 4625, the failed logon of an account that is already locked out.

No 4740 appears while the lockout threshold is 0, which is the value of the default domain policy and the effective default on domain controllers, member servers and workstations: accounts are then never locked out. Microsoft also notes that the built-in Administrator account is excluded from the lockout policy.

The event is written by the system, so Subject is normally SYSTEM. The locked account has no domain field: the field Windows calls TargetDomainName holds the Caller Computer Name, the computer from which the last failed attempt came.

How to turn it on

Advanced audit policy subcategory Audit User Account Management, Success. Set it in a Group Policy object linked to the computers that write the event:

Computer Configuration > Policies > Windows Settings > Security Settings > Advanced Audit Policy Configuration > Audit Policies > Account Management > Audit User Account Management
Microsoft's recommendation per computer role
ComputerAuditNote
Domain controllersSuccess and FailureMicrosoft's general and stronger baselines both recommend Success and Failure auditing. Microsoft calls the subcategory useful for watching critical domain accounts (domain admins, service accounts, database admins) and recommends Failure auditing mainly for invalid password change and reset attempts on domain accounts, failed changes of the DSRM password and failed SID History additions.
Member serversSuccess and FailureBoth baselines recommend Success and Failure auditing. Microsoft recommends watching every change to local user accounts, especially the built-in local Administrator and other critical accounts, and Failure auditing mainly for invalid password change and reset attempts on local accounts.
WorkstationsSuccess and FailureBoth baselines recommend Success and Failure auditing. Microsoft recommends watching every change to local user accounts, especially the built-in local Administrator and other critical accounts, and Failure auditing mainly for invalid password change and reset attempts on local accounts.
Check the current setting
auditpol /get /subcategory:"User Account Management"
Based on vendor documentation.
Turn it on (local policy; a domain GPO overrides it)
auditpol /set /subcategory:"User Account Management" /success:enable
Based on vendor documentation.
The same on a Windows in another display language
auditpol /get /subcategory:"{0CCE9235-69AE-11D9-BED3-505054503030}"
Based on vendor documentation.

Run the commands in an elevated prompt on a computer that writes the event. Subcategory settings take effect only when the security option Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings is enabled (the default), and a Group Policy object that sets advanced audit policy replaces local changes at its next refresh. Microsoft's advanced audit policy reference

Fields

In Event Viewer order. The field names are those of the event XML, from the event template that ships with Windows.

FieldWhat it holdsSince
Security IDSubjectUserSidSubjectSID of the account that performed the lockout, normally SYSTEM (S-1-5-18).v0
Account NameSubjectUserNameSubjectName of that account. With SYSTEM it is the computer account of the writing computer, such as DC01$.v0
Account DomainSubjectDomainNameSubjectDomain of that account; with SYSTEM, the domain of the writing computer.v0
Logon IDSubjectLogonIdSubjectLogon ID of that account's session, in hexadecimal. 0x3e7 for SYSTEM.v0
Security IDTargetSidAccount That Was Locked OutSID of the account that was locked out. Event Viewer resolves it to a name when it can.v0
Account NameTargetUserNameAccount That Was Locked OutName of the account that was locked out.v0
Caller Computer NameTargetDomainNameAdditional InformationCaller Computer Name (Event Viewer label): the computer from which the logon attempt came after which the account was locked out, for example WKS042. Despite the field name it is not the account's domain. Microsoft notes that a computer outside your domain still appears as a name, not an address.v0

Values to know

Caller Computer Name TargetDomainName

ValueMeaningSignal
A computer of your domainCaller Computer Name, where the failed attempts came fromUsually a device or service still using an old password, or a user who mistyped. Look at that computer for the process.Expected
A name not from your domainAttempts from an unknown computerMicrosoft suggests alerting on these. Password guessing from outside your estate shows this way when it reaches the threshold.Attack signal
EmptyNo computer name receivedMicrosoft notes for Microsoft Entra Domain Services that the name is empty when the failed attempt reached the domain controller through another server, such as a RADIUS server.Worth knowing

Security ID SubjectUserSid

ValueMeaningSignal
S-1-5-18SYSTEMThe normal writer of the event. Microsoft's sample shows the domain controller's computer account as the subject name.Expected
Any other SIDThe lockout was recorded under another accountMicrosoft recommends reporting every such event.Worth knowing

Volume and noise

Microsoft rates the volume of the subcategory as low. Most lockouts are ordinary: users who mistype or forget a new password, and devices, mapped drives, mail clients, services and scheduled tasks that keep presenting an old password after a change. Microsoft also notes that Kerberos can retry a sign-in while client, server and domain controller negotiate an encryption type, and those retries count toward the threshold.

Keeping it manageable

  • Keep every 4740: the volume is low and the lockout rule reads each event.
  • Alert on privileged and service accounts; for the rest, count lockouts per TargetDomainName (Caller Computer Name) to find the device that keeps using an old password, or the source of a guessing run.
  • Report every 4740 whose SubjectUserSid is not SYSTEM (S-1-5-18), as Microsoft recommends, because the event is normally written by SYSTEM.
  • Alert when the Caller Computer Name is not a computer of your domain, as Microsoft suggests. Even then the event gives a name, never an address: look for the address in 4625 or 4771 around the same time.

Sample event

Version 0, with made-up values.

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-Auditing" Guid="{54849625-5478-4994-a5ba-3e3b0328c30d}" />
    <EventID>4740</EventID>
    <Version>0</Version>
    <Level>0</Level>
    <Task>13824</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2026-11-18T09:30:12.4567890Z" />
    <EventRecordID>1048576</EventRecordID>
    <Correlation />
    <Execution ProcessID="712" ThreadID="2408" />
    <Channel>Security</Channel>
    <Computer>DC01.corp.example.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="TargetUserName">bob</Data>
    <Data Name="TargetDomainName">WKS042</Data>
    <Data Name="TargetSid">S-1-5-21-1004336348-1177238915-682003330-1121</Data>
    <Data Name="SubjectUserSid">S-1-5-18</Data>
    <Data Name="SubjectUserName">DC01$</Data>
    <Data Name="SubjectDomainName">CORP</Data>
    <Data Name="SubjectLogonId">0x3e7</Data>
  </EventData>
</Event>

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Why are there no 4740 events in my domain?

Either nothing reached the threshold or there is no threshold: Account lockout threshold 0, the value of the default domain policy, means accounts are never locked out and no 4740 is written. Check also that Audit User Account Management (Success) is enabled on the domain controllers.

How do I find where a lockout came from?

Read the Caller Computer Name (`TargetDomainName`). On that computer, the failed logons (4625) show the process and logon type. On the domain controllers, Kerberos pre-authentication failures (4771) for the account give the client address, and NTLM validation failures (4776) the workstation name.

Does password spraying cause 4740 events?

Usually not. Spraying tries few passwords per account, below the threshold, so no account locks out. Guessing against one account that goes past the threshold does. Count failed logons across many accounts (4625, 4771, 4776) to see spraying.

Is 4740 part of Audit Account Lockout?

No. Microsoft places 4740 under Audit User Account Management. Audit Account Lockout only records 4625 for a logon attempt against an account that is already locked out.

References