Admin Login

Active Directory Account Lockouts: Find the Source with Event ID 4740 and Fix the Cause

Common causes of account lockouts, Account Lockout Policy values, how to find the source and lifting the lock through self-service.

In Active Directory, a user may run into an "account locked out" warning even though they are trying to sign in with a password they believe is correct.

Unlocking the account is easy. What really matters is finding out why the account was locked.

Because an account whose underlying cause has not been removed may be locked again a few minutes later.

Why does an Active Directory account get locked?

When the number of failed authentication attempts defined in the Account Lockout Policy is reached, Active Directory can lock the account.

The simplest scenario is the user entering the wrong password repeatedly.

However, with lockouts that keep repeating, the source may be another system.

Common causes include:

  • Mobile devices still using an old password
  • Credentials saved in Windows Credential Manager
  • Mapped drive connections using an old password
  • Scheduled tasks
  • Windows services
  • Outlook or other e-mail clients
  • VPN clients
  • Remote desktop sessions
  • Old credentials saved on more than one device

What is the Account Lockout Policy?

Active Directory can determine how it behaves towards incorrect password entries through Group Policy.

The policy usually contains three core values:

Account lockout threshold: The number of failed sign-in attempts allowed before the account is locked.

Account lockout duration: How long a locked account stays locked.

Reset account lockout counter after: When the failed sign-in counter is reset.

These values should be determined in line with the organisation's security policy.

How is a locked account unlocked?

An authorised administrator can open the user's properties in Active Directory Users and Computers and lift the lock on the account.

In environments where PowerShell is used, the operation can also be carried out with the relevant Active Directory cmdlets.

However, if the user's account keeps getting locked, lifting the lock alone does not solve the problem.

How is the source of the lockout found?

When an account is locked, the domain controller that handled the request reports it to the domain controller holding the PDC emulator role, which writes event 4740 ("A user account was locked out") to its security log. That is where the search starts, rather than going through every domain controller one by one.

Two fields in event 4740 matter:

  • Target Account Name: the account that was locked.
  • Caller Computer Name: the device the failed sign-ins came from.

You can list recent events with PowerShell:

$pdc = (Get-ADDomain).PDCEmulator
Get-WinEvent -ComputerName $pdc -FilterHashtable @{ LogName = 'Security'; Id = 4740 } -MaxEvents 50 |
  Select-Object TimeCreated,
    @{ n = 'User';   e = { $_.Properties[0].Value } },
    @{ n = 'Device'; e = { $_.Properties[1].Value } }

If the same device name keeps appearing, the problem is on that device. Common patterns:

  • A phone's name: usually a phone trying to sync mail with the old password.
  • A server name: look for a Windows service, scheduled task or mapped drive still running with the old password.
  • The user's own computer: an old credential left in Credential Manager.

Caller Computer Name is sometimes empty, or only shows an Exchange, VPN or RDP gateway server. When it is empty, look at these events for the same time window on the domain controller that handled the request:

  • 4771 (Kerberos pre-authentication failed): includes the client's IP address.
  • 4776 (NTLM authentication): includes the name of the workstation that sent the request.
  • 4625 (logon failure): recorded on the server that received the sign-in; shows the network address and process.

When the field shows a gateway server, the authentication was relayed through it, and the real client has to be found in that server's own logs (for example IIS or VPN logs).

Unlocking the account without updating the old credential on the source device only postpones the problem: the account locks again a few minutes later.

If the user knows the correct password, why reset it?

It does not need to be reset.

This distinction is important in helpdesk operations.

A user who has forgotten their password: needs to set a new one.

A user who knows their password but whose account is locked: may only need the account lock to be lifted.

Managing both scenarios as the same process can lead to unnecessary password changes.

Can account unlock be done through self-service?

It can, if an identity verification mechanism is available.

For example, a one-time verification code can be sent to the phone number registered on the user's Active Directory account.

When verification succeeds, the account lock is lifted. The user's existing password stays unchanged.

That way, in simple account lockout cases, the user does not need to create a helpdesk request.

Which accounts should not be opened to self-service?

More tightly controlled procedures may be preferred for privileged accounts.

Excluding critical groups such as Domain Admins and Enterprise Admins from the standard self-service portal can be assessed depending on the organisation's security model.

If the self-service scope can be limited at user, group or OU level, this distinction is easier to manage.

Account unlock with PRESS

In PRESS, account unlock is a self-service flow separate from password reset.

The user identifies their account, verifies their identity with the SMS code sent to their registered phone number, and the account lock is lifted.

The password is not changed.

The operation carried out is written to the audit log with its time, source IP and outcome.

The user details page in the admin panel shows which device locked the account in the last 7 days, read from event 4740, so the command above does not have to be run by hand each time.

You can see how the flow works in the PRESS live demo.

Evaluate PRESS in your own environment.

Through the live demo you can explore the user portal and the admin panel directly.