Guide

Set password and lockout policies

A new domain allows 7-character passwords and never locks an account, however many wrong guesses are made. Fine-grained password policies fix both, and let admins have a stricter rule than everyone else.

15 minutesRun as a domain admin on CON-DC-01
What improves

Passwords are longer and guessing is cut off.

Why it matters

A new domain allows 7-character passwords and unlimited wrong guesses.

How you do it

Create one policy for all users and a stricter one for admins, then check who gets which.

What you are setting

PolicyApplies toMinimum lengthLockout
CON-PSO-AllUsersDomain Users1415 minutes after 10 wrong tries
CON-PSO-AdminsDomain Admins1630 minutes after 5 wrong tries

When two policies apply to one person, the lower precedence number wins. Admins are in both groups, so they get the admin policy.

Why not edit the Default Domain Policy?

You can, but it gives one rule for everybody. Fine-grained policies sit on top of it and cannot be overwritten by Group Policy.

Create the policy for everyone

CON-DC-01
New-ADFineGrainedPasswordPolicy -Name 'CON-PSO-AllUsers' -Precedence 50 `
    -MinPasswordLength 14 -PasswordHistoryCount 24 -ComplexityEnabled $true -ReversibleEncryptionEnabled $false `
    -MinPasswordAge 1.00:00:00 -MaxPasswordAge 0.00:00:00 `
    -LockoutThreshold 10 -LockoutDuration 00:15:00 -LockoutObservationWindow 00:15:00 `
    -ProtectedFromAccidentalDeletion $true
Add-ADFineGrainedPasswordPolicySubject -Identity 'CON-PSO-AllUsers' -Subjects 'Domain Users'

Create the stricter policy for admins

CON-DC-01
New-ADFineGrainedPasswordPolicy -Name 'CON-PSO-Admins' -Precedence 10 `
    -MinPasswordLength 16 -PasswordHistoryCount 24 -ComplexityEnabled $true -ReversibleEncryptionEnabled $false `
    -MinPasswordAge 1.00:00:00 -MaxPasswordAge 0.00:00:00 `
    -LockoutThreshold 5 -LockoutDuration 00:30:00 -LockoutObservationWindow 00:30:00 `
    -ProtectedFromAccidentalDeletion $true
Add-ADFineGrainedPasswordPolicySubject -Identity 'CON-PSO-Admins' -Subjects 'Domain Admins'
PartMeaning
MaxPasswordAge 0Passwords do not expire on a timer. The NCSC advises long passwords over regular forced changes. Use 90.00:00:00 if your policy needs expiry.
LockoutObservationWindowHow long the count of wrong tries is remembered.
LockoutDurationHow long the account stays locked before it unlocks by itself.

Check who gets which policy

Test with one ordinary user and one admin.

CON-DC-01
Get-ADFineGrainedPasswordPolicy -Filter * | Format-Table Name, Precedence, MinPasswordLength, LockoutThreshold -AutoSize
(Get-ADUserResultantPasswordPolicy -Identity doej).Name
(Get-ADUserResultantPasswordPolicy -Identity Administrator).Name

The user should return CON-PSO-AllUsers and the admin CON-PSO-Admins.

What users notice

  • Existing passwords keep working. The new length applies the next time someone changes their password.
  • Lockout starts straight away. A locked account unlocks by itself when the time is up.
  • Younger pupils may need a shorter rule. Add a third policy for a pupil group with a lower precedence number than 50.

Unlock an account early

CON-DC-01
Unlock-ADAccount -Identity doej

Done when

Check

Both policies are listed, an ordinary user returns CON-PSO-AllUsers and an admin returns CON-PSO-Admins.

Your progress is kept in this browser only.