Emergency server help: get in touch

Fine-Grained Password Policy (PSO) in Active Directory: 2026 Setup

How to create Password Settings Objects with New-ADFineGrainedPasswordPolicy or the Administrative Center, apply stricter or looser rules to specific groups, control precedence, and confirm which policy a user actually receives.

Published Updated 10 min read

Short answer: Create a PSO with New-ADFineGrainedPasswordPolicy -Name "Admins-PSO" -Precedence 10 -MinPasswordLength 16 -MaxPasswordAge 90.00:00:00 -LockoutThreshold 5 -ComplexityEnabled $true, apply it to a global group with Add-ADFineGrainedPasswordPolicySubject -Identity Admins-PSO -Subjects "Tier0-Admins", and check the result on a user with Get-ADUserResultantPasswordPolicy jsmith. The PSO with the lowest precedence number wins when a user is in several groups, and a PSO linked directly to a user always beats one linked through a group. (Reviewed November 2026.)

The Default Domain Policy sets one password and lockout policy for every user in the domain, which is rarely what you want: privileged accounts should have longer passwords and faster lockouts, while a handful of service accounts may need exemptions from expiry. Fine-grained password policies, stored as Password Settings Objects (PSOs) in the Password Settings Container, apply different rules to specific users or global security groups without touching the domain-wide defaults. They require a domain functional level of Windows Server 2008 or higher, which every Windows Server 2019, 2022 and 2025 domain meets.

Plan the policies before creating them

PSOs apply only to users and global security groups, never to OUs, universal groups or computers. Decide on a small set, typically three:

  • Privileged accounts: length 16 or more, 90-day maximum age, five-attempt lockout for 30 minutes, complexity on
  • Standard users: usually left on the domain default, or a PSO that matches the default with a lower precedence so future changes are explicit
  • Service accounts: long passwords, no expiry (for no expiry, set -PasswordNeverExpires $true on the service account and use the PSO for length and lockout), lockout disabled to avoid a mis-typed password taking down an application

Precedence is an integer; lower wins. Leave gaps (10, 20, 30) so you can insert policies later. Also check the domain policy first, because PSO lockout settings take over completely for their subjects, including observation window and duration:

Get-ADDefaultDomainPasswordPolicy

Create and apply a PSO with PowerShell

New-ADFineGrainedPasswordPolicy -Name "Tier0-Admins-PSO" -Precedence 10 `
  -ComplexityEnabled $true -MinPasswordLength 16 -PasswordHistoryCount 24 `
  -MinPasswordAge 1.00:00:00 -MaxPasswordAge 90.00:00:00 `
  -LockoutThreshold 5 -LockoutDuration 0.00:30:00 -LockoutObservationWindow 0.00:30:00 `
  -ReversibleEncryptionEnabled $false -ProtectedFromAccidentalDeletion $true

Add-ADFineGrainedPasswordPolicySubject -Identity "Tier0-Admins-PSO" -Subjects "Tier0-Admins","Domain Admins"

Timespans use the days.hours:minutes:seconds format. For a service account policy:

New-ADFineGrainedPasswordPolicy -Name "ServiceAccounts-PSO" -Precedence 20 `
  -ComplexityEnabled $true -MinPasswordLength 25 -PasswordHistoryCount 5 `
  -MinPasswordAge 0 -MaxPasswordAge 365.00:00:00 -LockoutThreshold 0
Add-ADFineGrainedPasswordPolicySubject -Identity "ServiceAccounts-PSO" -Subjects "SVC-Accounts"

The same objects can be created in the Active Directory Administrative Center: open the domain, go to System » Password Settings Container, and choose New » Password Settings. The form exposes every attribute and a “Directly Applies To” list for subjects. In Active Directory Users and Computers, PSOs are only visible with View » Advanced Features enabled, under System » Password Settings Container, and editing them there requires the Attribute Editor.

What each PSO setting means

A PSO has to define every password and lockout setting; nothing is merged from the domain policy or from other PSOs. The values that trip people up:

ParameterValueWatch out for
-PrecedenceInteger, 1 or higher; lower winsRequired. If the number is already used by another PSO, the cmdlet stops with an error
-MinPasswordAge / -MaxPasswordAgeTimespan, D.H:M:SA minimum age stops users cycling through the history straight back to their old password
-ComplexityEnabled$true or $falseRequires three of four types: upper case, lower case, digits, special characters
-LockoutThresholdFailed attempts; 0 never locksNever locking stops lockout-based denial of service but gives no brute-force protection
-LockoutDurationTimespan; 0 means an admin must unlockMust be greater than or equal to the observation window
-LockoutObservationWindowTimespanMust not exceed the duration; 0 effectively means the account never locks
-ReversibleEncryptionEnabled$true or $falseKeep it $false; it stores passwords in a recoverable form

Check what a user actually gets

Because a user can be in several groups, the effective policy is not always obvious:

Get-ADUserResultantPasswordPolicy -Identity jsmith
Get-ADFineGrainedPasswordPolicy -Filter * | Select-Object Name, Precedence, AppliesTo
Get-ADUser jsmith -Properties msDS-ResultantPSO | Select-Object msDS-ResultantPSO

If the first command returns nothing, the user falls under the Default Domain Policy. Membership changes take effect immediately for new password attempts, but a user who is already logged on is not forced to change anything until their current password reaches the new maximum age. To force an immediate change for a group, set -ChangePasswordAtLogon $true with Set-ADUser. Note that Windows LAPS-managed local accounts are not affected by PSOs; their rules come from the LAPS policy described in set up Windows LAPS.

Apply a PSO to an OU with a shadow group

PSOs cannot be linked to an OU. Microsoft’s documented workaround is a shadow group: a global security group that mirrors the OU’s users, with the PSO linked to the group. For an OU of finance staff, create the group and link the PSO once:

New-ADGroup -Name "PSO-Finance" -GroupScope Global -GroupCategory Security `
  -Path "OU=Groups,DC=corp,DC=example,DC=com" -Description "Shadow group for OU=Finance"
Add-ADFineGrainedPasswordPolicySubject -Identity "Finance-PSO" -Subjects "PSO-Finance"

The group does not follow the OU by itself. Re-running New-ADGroup fails because the group already exists, and adding members again never removes users who have left the OU, so they would keep the Finance PSO. Keep the membership in step with a reconcile script that adds users who moved in, removes users who moved out, and changes nothing if the directory query fails. Run it from a scheduled task, for example hourly, under an account allowed to manage that group:

# Sync-PsoFinance.ps1 - keeps PSO-Finance equal to the users in OU=Finance
$ErrorActionPreference = 'Stop'
$ou    = "OU=Finance,DC=corp,DC=example,DC=com"
$group = "PSO-Finance"
try {
    $inOu    = @(Get-ADUser -Filter * -SearchBase $ou -SearchScope Subtree |
                 Select-Object -ExpandProperty DistinguishedName)
    $members = @((Get-ADGroup -Identity $group -Properties member).member)
} catch {
    Write-Error "AD query failed, membership left unchanged: $_"
    exit 1
}
if ($inOu.Count -eq 0) {
    Write-Error "No users found under $ou; refusing to empty $group"
    exit 1
}
$toAdd    = @($inOu    | Where-Object { $_ -notin $members })
$toRemove = @($members | Where-Object { $_ -notin $inOu })
if ($toAdd.Count)    { Add-ADGroupMember    -Identity $group -Members $toAdd }
if ($toRemove.Count) { Remove-ADGroupMember -Identity $group -Members $toRemove -Confirm:$false }
"Added $($toAdd.Count), removed $($toRemove.Count)"

Reading the group’s member attribute avoids the 5,000-member limit of Get-ADGroupMember. Use the group only for this OU: the script removes anything in it that is not a user under the OU. To test it, move a test user into the OU, run the script and check Get-ADUserResultantPasswordPolicy testuser shows Finance-PSO; then move the user out, run it again and confirm the PSO no longer applies.

The empty-OU safeguard is deliberate: a query that wrongly returns no users must not strip the PSO from everyone. The side effect is that when the OU really is emptied, the last users to leave stay in the group and keep the Finance PSO. Clear them by hand once you have confirmed the OU exists and holds no users:

$ou    = "OU=Finance,DC=corp,DC=example,DC=com"
$group = "PSO-Finance"
Get-ADOrganizationalUnit -Identity $ou | Select-Object DistinguishedName   # the OU exists, so an empty result is real
(Get-ADUser -Filter * -SearchBase $ou -SearchScope Subtree | Measure-Object).Count   # must be 0
$left = @((Get-ADGroup -Identity $group -Properties member).member)
$left                                                                       # review who is still in the group
if ($left.Count) { Remove-ADGroupMember -Identity $group -Members $left -Confirm:$false }
@((Get-ADGroup -Identity $group -Properties member).member).Count           # 0
Get-ADUserResultantPasswordPolicy -Identity "former.finance.user"           # no longer Finance-PSO

To confirm an existing group qualifies before you link a PSO to it:

Get-ADGroup "Tier0-Admins" | Select-Object Name, GroupScope, GroupCategory

Verify and avoid the common trap

Test with a user in the group: reset the password to something short and expect “The password does not meet the length, complexity or history requirements”. Then check the lockout behaviour by entering a wrong password the threshold number of times and confirming Event ID 4740 on the PDC emulator, as covered in find the source of AD account lockouts. The most common mistake is applying a PSO to a universal or domain local group; the cmdlet accepts it silently in some versions but the policy never applies, and Get-ADUserResultantPasswordPolicy will show the domain default. Keep subjects as global groups and review AppliesTo quarterly.

Troubleshooting PSO problems

SymptomCauseFix
The user still gets the domain defaultThe PSO is linked to a domain local, universal or distribution group; only global security groups and users countCheck GroupScope and GroupCategory, then link the PSO to a global security group
The password never expires despite -MaxPasswordAgeThe account has “Password never expires” set; that flag overrides the PSOSet-ADUser jsmith -PasswordNeverExpires $false if the exemption is not intended
New-ADFineGrainedPasswordPolicy fails straight awayThe precedence value is already in use, or the lockout duration is shorter than the observation windowPick an unused number from your gaps; make duration equal to or longer than the window
Help desk staff see the PSO name but no settingsBy default only Domain Admins can read PSO settings; users can read only the PSO’s distinguished nameDelegate read permission on the Password Settings Container to the help desk group
Two PSOs are linked directly to one userThe lower precedence wins and a warning is logged in the Active Directory event logLink one PSO per user at most; prefer groups
The cmdlets fail on a branch-office DCThe PSO cmdlets do not work against a read-only domain controllerAdd -Server with a writable DC

Change or roll back a PSO safely

A PSO with a tight lockout can lock out every administrator at once, so link a new or changed policy to a small pilot group first and add Domain Admins only after the pilot has worked for a day. To change or remove a policy, unlink first, confirm, then delete:

Get-ADFineGrainedPasswordPolicySubject -Identity "Tier0-Admins-PSO" | Select-Object Name, ObjectClass
Set-ADFineGrainedPasswordPolicy -Identity "Tier0-Admins-PSO" -LockoutThreshold 10
Remove-ADFineGrainedPasswordPolicySubject -Identity "Tier0-Admins-PSO" -Subjects "Domain Admins"
Get-ADUserResultantPasswordPolicy -Identity jsmith
Set-ADFineGrainedPasswordPolicy -Identity "Tier0-Admins-PSO" -ProtectedFromAccidentalDeletion $false
Remove-ADFineGrainedPasswordPolicy -Identity "Tier0-Admins-PSO" -Confirm:$false

Record the subject list from the first command before you remove anything; it is your way back. Removing subjects is instant and reversible with Add-ADFineGrainedPasswordPolicySubject, while deleting the PSO loses its settings, so keep the New-ADFineGrainedPasswordPolicy line you used in your change notes. If an administrator is already locked out by an aggressive policy, any other admin can unlock the account with Unlock-ADAccount while you fix the PSO.

Fine-grained password policy at a glance

Fine-Grained Password Policy summary card: Create a PSO with New-ADFineGrainedPasswordPolicy -Name "Admins-PSO" -Precedence 10 -MinPasswordLength 16…
In short: Create a PSO with New-ADFineGrainedPasswordPolicy -Name "Admins-PSO" -Precedence 10 -MinPasswordLength 16 -MaxPasswordAge 90.00:00:00 -LockoutThreshold 5 -ComplexityEnabled $true, apply it to a global group with…
Fine-Grained Password Policy – questions answered
Fine-Grained Password Policy: the questions this guide answers.

Official documentation: Active Directory Domain Services docs, Windows Server documentation, Remove-ADGroupMember reference.

Related guides: Set up Windows LAPS on Windows Server 2025 and Windows 11 · Find the source of AD account lockouts with event 4740 · Send AD password expiry reminder emails with PowerShell · Create and test a gMSA service account.

Frequently asked questions

Does a fine-grained password policy override the Default Domain Policy for lockouts as well?

Yes; a PSO defines the complete set of password and lockout settings for its subjects, so if you leave the lockout values at defaults in the PSO, those defaults apply rather than the domain policy’s values.

How long does it take for a new PSO to apply to users?

It applies as soon as the PSO and the group membership have replicated to the DC the user authenticates against, typically under 15 minutes; existing passwords are not invalidated, only checked against the new rules at the next change or expiry.

Can I undo a PSO or remove a user from it?

Yes; remove subjects with Remove-ADFineGrainedPasswordPolicySubject or delete the PSO after clearing its accidental-deletion protection, and affected users immediately revert to the next applicable PSO or the domain default.

Can I apply a fine-grained password policy to an OU?

Not directly. PSOs apply only to users and global security groups. Create a global security group that contains the OU’s users (a shadow group), link the PSO to that group, and update the membership whenever users move between OUs.

What happens if two PSOs have the same precedence?

New-ADFineGrainedPasswordPolicy refuses a precedence value that is already in use, but duplicates can still be created with other tools. If a user ends up with two PSOs of equal precedence, the one with the smallest GUID applies, which is hard to predict, so give every PSO a unique value.

Share this guide

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.