Skip to content

Troubleshoot Active Directory Account Lockouts

Admin
November 18, 2026
5 min read
Intermediate
💻 Target OS: Windows Server 2025 / 2022 (AD DS)

Before you begin

  • Applies to:Active Directory Domain Services on Windows Server 2022 or 2025.
  • Where to start:Open PowerShell 7 or later on an admin workstation with the RSAT Active Directory tools. Keep the same shell for steps that share variables.
  • What you need:Have the affected account and domain controller names, delegated directory read access, and access to Security logs on the relevant controllers. Unlocking requires separate delegated rights.
Guide tools
Guide tools
0/0 Steps (0%)

Use this guide when one domain account repeatedly locks out, especially after a password change. When many unrelated accounts lock out together, preserve the evidence and involve the security team.

Troubleshooting Steps

01

Confirm the account and find the PDC emulator

Inventory

Run on the admin workstation. Replace alice with the affected account’s SAM account name. Record the account SID and the time reported by the user. LockedOut describes the responding controller’s current view, which can differ briefly across controllers.

Terminal window
$User = 'alice'
$Pdc = (Get-ADDomain).PDCEmulator
$Account = Get-ADUser -Identity $User -Server $Pdc -Properties LockedOut, PasswordLastSet -ErrorAction Stop
$Account | Select-Object SamAccountName, SID, LockedOut, PasswordLastSet
$Pdc
02

Read lockout events for the account

Event 4740

Start on the PDC emulator, then repeat on the authenticating controller or in centralized logs if needed. This query displays events from the last two hours whose named event fields match the account SID. In documented 4740 XML, the caller can appear in TargetDomainName. Remote event log access failures need separate investigation. No matching event can also mean that auditing, retention, or the time window needs review.

Terminal window
$Filter = @{ LogName = 'Security'; Id = 4740; StartTime = (Get-Date).AddHours(-2) }
Get-WinEvent -ComputerName $Pdc -FilterHashtable $Filter | ForEach-Object {
$EventXml = [xml]$_.ToXml()
$Fields = @{}
foreach ($Entry in $EventXml.Event.EventData.Data) {
$Fields[[string]$Entry.Name] = [string]$Entry.'#text'
}
if ($Fields.TargetSid -eq $Account.SID.Value) {
$Caller = $Fields.CallerComputerName
if (-not $Caller) { $Caller = $Fields.TargetDomainName }
[pscustomobject]@{
TimeCreated = $_.TimeCreated
DomainController = $_.MachineName
User = $Fields.TargetUserName
Caller = $Caller
}
}
}
03

Trace retries on the caller

Correlation

On the identified Windows host, inspect services and tasks running as the account. Caller Computer Name can be blank or point to an intermediary such as a gateway. Correlate the timestamp with authentication logs, including 4625 on the system rejecting a logon and 4771 or 4776 on the relevant controller when audited. Check mapped drives and saved credentials in the affected user’s session.

Terminal window
Get-CimInstance Win32_Service |
Select-Object Name, StartName, State
Get-ScheduledTask |
Select-Object TaskPath, TaskName, @{Name='RunAs'; Expression={$_.Principal.UserId}}
04

Correct the source and verify the unlock

Verification

Have the owner update or remove the confirmed stale credential through the service’s supported process. Keep a record of what changed and verify the dependent service or task. If the verified user is still locked out, use the delegated unlock procedure below. Confirm one normal sign-in and monitor for fresh 4740 events across at least one retry interval.

Terminal window
Unlock-ADAccount -Identity $User -Server $Pdc -ErrorAction Stop
Get-ADUser -Identity $User -Server $Pdc -Properties LockedOut |
Select-Object SamAccountName, LockedOut

References

Comments