Skip to content
Tutorials Center
My learning

Topics

Lesson 34 of 38 ยท Administration

Password Policies, Fine-Grained Policies and Account Lockout

Configure Active Directory password policy: the domain-wide policy, fine-grained password settings objects and their precedence, lockout threshold and observation window, and modern guidance.

Passwords remain the main way people prove who they are in a domain, and two things go wrong in practice: rules that are too weak let attackers guess them, and rules that are too strict make people write them on sticky notes or lock themselves out every Monday. This lesson explains the knobs Active Directory gives you, how the domain policy and fine-grained password policies (FGPP) combine, how lockout works and what current guidance recommends.

Group Policy and the admin consoles cannot run here, so settings are shown as text. The Python examples model the decisions (which policy applies, whether an account locks) so you can try numbers before changing production.

The domain password policy

Password and account-lockout settings for all users live in the Default Domain Policy (Computer Configuration > Windows Settings > Security Settings > Account Policies). Active Directory reads only the policy linked at the domain root, and applies it to all domain accounts; a password policy linked to an OU has no effect on domain users. The settings:

Setting Meaning Typical modern value
Minimum password length Characters 12 to 14 or more
Password must meet complexity requirements Three of four character classes, no name parts Often On, or replaced by a banned-password list
Enforce password history Remembered previous passwords 24
Maximum password age Days until forced change 0 (never) if breached-password screening and MFA exist, else 365
Minimum password age Days before another change 1 (stops cycling through history)
Store passwords using reversible encryption Equivalent to storing plaintext Off
Account lockout threshold Failed attempts before lock 5 to 10
Account lockout duration Minutes locked (0 means until an admin unlocks) 15 to 30
Reset account lockout counter after The observation window 15 to 30

Current guidance (NIST SP 800-63B and similar) is to prefer length over complexity, to check new passwords against lists of leaked and common passwords, to avoid forced periodic rotation without evidence of compromise, and to add multi-factor authentication. The built-in complexity rule is blunt; products and the Entra password protection agent can add a custom banned list.

Fine-grained password policies

The domain-wide rule is too rigid when administrators need a 20-character minimum while a kiosk account needs something simpler. Password Settings Objects (PSOs) let you apply different password and lockout rules to specific users or global security groups, in the same domain. A PSO is an object in CN=Password Settings Container,CN=System, with the attribute msDS-PSOAppliesTo listing users or groups and a numeric precedence.

POWERSHELL
New-ADFineGrainedPasswordPolicy -Name "Admins-Strict" -Precedence 10 `
  -MinPasswordLength 20 -PasswordHistoryCount 24 -ComplexityEnabled $true `
  -LockoutThreshold 3 -LockoutDuration 00:30:00 -LockoutObservationWindow 00:30:00 `
  -MaxPasswordAge 365.00:00:00 -ReversibleEncryptionEnabled $false
Add-ADFineGrainedPasswordPolicySubject "Admins-Strict" -Subjects "Domain Admins"
Get-ADUserResultantPasswordPolicy alice

Get-ADUserResultantPasswordPolicy (and ADUC's Password Settings tab) shows which one wins.

Which PSO wins

  1. A PSO linked directly to the user beats group-linked ones.
  2. Otherwise, among PSOs reached through groups, the lowest precedence number wins.
  3. If precedence ties, the PSO with the lowest GUID wins.
  4. If no PSO applies, the domain policy applies.

PSOs apply to users and inetOrgPerson objects, not to computers, and the link must be to a global security group (or user), not an OU, which is a common surprise.

Python Resultant password policy (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

How account lockout works

Lockout slows password guessing. Three numbers define it: threshold (N failures), observation window (failures older than this are forgotten) and duration (how long the account stays locked). The count is kept per user, and a bad password is counted on the DC that processes it; failures are forwarded to the PDC emulator so the count is consistent across the domain and bad-password reports (event 4740 logs the lockout on the PDC emulator and the caller computer name).

Python Lockout simulator

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The same logic explains password spraying: an attacker tries one password against thousands of accounts, staying below the threshold on each. A low threshold does not stop that, but monitoring the many 4771 and 4625 events from one source, banned-password lists and MFA do.

Lockout troubleshooting

  • A user who is locked again minutes after unlocking usually has a stale credential somewhere: a mapped drive, a phone with mail configured, a service or scheduled task using their password, an old RDP session.
  • Find the source with event 4740 on the PDC emulator (the Caller Computer Name field), and the Microsoft Account Lockout Status tools or PowerShell Search-ADAccount -LockedOut.
  • Setting the threshold to 0 disables lockout, which is almost never advisable. A very low threshold (3) lets an attacker deliberately lock out users (denial of service), so balance it with detection.
  • Smart lockout in Microsoft Entra ID distinguishes familiar from unfamiliar locations; on-premises AD has no equivalent, so consider a perimeter control for externally exposed endpoints such as Exchange or ADFS.

Service accounts and special cases

  • Service account passwords should be long and random, with a PSO that sets a large minimum length, or better, a gMSA that has no human password.
  • Accounts flagged Password never expires are the natural place for a Kerberoasting target; inventory them with a PowerShell report.
  • Emergency (break-glass) accounts need very long passwords stored offline and alerting on any use.
  • Computer accounts rotate their own passwords every 30 days automatically; this is separate from user policy.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Where must the domain-wide password policy be linked to take effect for domain users?

    Active Directory reads the password policy only from a GPO linked at the domain root (apart from fine-grained policies).
  2. 2. Two group-linked PSOs apply to a user and have precedence 10 and 20. Which wins?

    The lowest precedence number wins; a PSO linked directly to the user would beat both.
  3. 3. What can a PSO be applied to?

    PSOs are linked to user accounts or global security groups, never directly to OUs.
  4. 4. A user is locked out again soon after every unlock. What is the most probable cause?

    Stale credentials on a phone, mapped drive or service keep sending bad passwords; event 4740 names the source.
  5. 5. What does current guidance emphasise over complexity rules?

    Long passphrases and screening with MFA give better security than arbitrary complexity and frequent rotation.

Summary

  • The domain policy (Default Domain Policy at the root) covers everyone; PSOs refine it for users and global groups.
  • Direct links beat group links; among groups the lowest precedence number wins.
  • Lockout has a threshold, an observation window and a duration, processed with the PDC emulator.
  • Prefer length, banned-password checks and MFA, and track down stale credentials with event 4740.

Next: Backup, Recovery and Maintenance