Admin Power Level: Intermediate Chapter 15: Small Commands, Big Everyday Wins

Fine grained password policies (FGPP)

A fine grained password policy gives a different password and lockout policy to a group of users, instead of one policy for the whole domain. It is applied through a password settings object.

Lesson 2 of 5 in Chapter 15: Small Commands, Big Everyday Wins. Previous step in this path: Internet: get content from a web page. 3 learning objectives, 6 examples, and a knowledge check.

Start: what you will learn

A fine grained password policy gives a different password and lockout policy to a group of users, instead of one policy for the whole domain. It is applied through a password settings object.

Learning objectives

  • Explain what FGPP changes and what it does not change
  • Create a password settings object
  • Assign it to a group and read it back

Concept in simple words

What it is: a fine grained password policy, often shortened to FGPP, gives a different password and lockout policy to one group of users, instead of using one policy for the whole domain. It is stored as a password settings object, often shortened to PSO, which is a saved set of rules you can assign to a group. The default domain policy still covers everyone else, so FGPP adds extra rules on top, it does not delete the normal rules.

Why it works

Why one policy for everyone is not enough: imagine one rule for every user, from a student style account to a highly privileged admin account. The admin account is a bigger target, so it should need a longer password and lock sooner after bad tries. If you raise the rule for everyone to admin level, every user gets more friction. If you keep it low for everyone, the admin account stays too weak. FGPP solves that tension by letting one group follow stricter rules while everyone else keeps the normal rules.

What PowerShell does behind the command: New-ADFineGrainedPasswordPolicy creates a PSO in the directory, and Add-ADFineGrainedPasswordPolicySubject links that PSO to its subjects, which are the users or groups it applies to. Get-ADFineGrainedPasswordPolicy reads a PSO back so you can check it. The PSO itself does not change passwords at once, it sets the rules that apply when a password is next changed or checked, and it sets the lockout rules that apply when bad tries happen.

Precedence, the heart of FGPP: every PSO has a precedence number, and -Name and -Precedence are the two values you must give when you create one. When a user is covered by more than one group PSO, the PSO with the lowest precedence number wins, because a smaller number means higher priority. Think of it as queue numbers: number 10 is served before number 20. Space your numbers out, such as 10, 20, and 30, instead of 1, 2, and 3, so you can add a new policy in between later without renumbering everything.

Two extra precedence rules that save confusion: first, a PSO assigned directly to a user beats a PSO assigned through a group, whatever the numbers say, so a direct assignment is the strongest link. Second, if two group PSOs have exactly the same precedence number, the tie is broken by the smaller object identifier, which is effectively arbitrary, so never rely on a tie. Keep numbers distinct, keep direct assignments rare, and assign to groups as your normal habit, so the result stays easy to explain.

Who a PSO can apply to, and who it cannot: a PSO applies only to user objects and to global security groups. It does not apply directly to an organisational unit, to a computer, or to a distribution group. If your thinking starts from an organisational unit, the usual workaround is a shadow group, which is a global security group whose members mirror the people in that unit, and you assign the PSO to that group. A shadow group needs care, because new people added to the unit do not join the group by themselves, so someone must keep the membership in step.

The settings, one by one: -MinPasswordLength sets the shortest password allowed, in characters, so 14 means at least 14 characters. -ComplexityEnabled $true turns on complexity rules, which require a mix of character types, such as upper case, lower case, digits, and symbols. -PasswordHistoryCount says how many old passwords are remembered, so a user cannot simply reuse a recent password. -MaxPasswordAge says how long a password may live before it must change, and -MinPasswordAge says how soon after a change a password may be changed again. -LockoutThreshold is the number of bad tries before the account locks, -LockoutObservationWindow is the window in which those bad tries are counted, and -LockoutDuration is how long the lock lasts. -ReversibleEncryptionEnabled should stay $false in normal use, because $true would store passwords in a reversible form, which is much weaker.

A setting you do not name is not the same as a setting you set on purpose. When you create a PSO, check every value you care about by reading the policy back, because a value you forgot may sit at a default that is weaker or stricter than you intended. This is why the lesson habit is always create, assign, read back. Reading back is not extra work, it is the check that proves the policy you meant is the policy that exists.

Think of it like this

Think of it like this: two different dress codes in one school. Most students follow the normal dress code, but the lab group follows a stricter one with extra safety gear. The stricter code does not change the normal code for everyone else, it only applies to the group it was assigned to, and if a student is in two special groups, the group with the higher priority wins. A direct rule for one student would beat even that, just as a direct PSO assignment beats a group assignment.

How it works, step by step

How it works, step by step: First, decide which group needs stricter rules, and write down what those rules should be, such as a longer minimum password length or a lower lockout threshold, which is the number of bad tries before an account locks. Second, create the policy with New-ADFineGrainedPasswordPolicy, giving it a clear name, a precedence number, and the settings you chose. Third, assign it to a group with Add-ADFineGrainedPasswordPolicySubject, not to single users one by one. Fourth, read it back with Get-ADFineGrainedPasswordPolicy to confirm the name, the precedence, and the settings. Fifth, check one test user with the resultant policy command, so you know which policy really applies to that user, instead of guessing from the group list.

Let us walk through the first example: look at the lesson example for admins. -Name gives the policy a clear name, AdminPolicy, and -Precedence 10 sets its priority. -MinPasswordLength 14 requires passwords of at least 14 characters, -ComplexityEnabled $true turns on complexity rules, which require a mix of character types, and -LockoutThreshold 3 locks an account after three bad tries. In the output, look for a confirmation that the policy was created, then read it back to check that the numbers match what you intended, because a wrong precedence number can let a weaker policy win. If you change Precedence from 10 to 50, this policy would lose to any competing policy numbered below 50, even though its password rules are stricter.

Let us walk through the second example: take Add-ADFineGrainedPasswordPolicySubject -Identity "AdminPolicy" -Subjects "Admins". -Identity names the policy you just created, and -Subjects names the group that should receive it. This is a link, not a copy: members of Admins now fall under AdminPolicy, and a person who later joins Admins picks up the rules automatically, without you editing that person one by one. If you run this command with a group name that does not exist, or with an organisational unit name, it will not do what you meant, because subjects must be users or global security groups.

Let us walk through the third example: take Get-ADFineGrainedPasswordPolicy -Identity "AdminPolicy" | Select-Object Name, Precedence, MinPasswordLength. Get-ADFineGrainedPasswordPolicy reads back one policy. -Identity names the policy to read, using the same name as the creation example in the lesson. Select-Object keeps only Name, Precedence, and MinPasswordLength, so you can quickly check the priority number and the minimum length without scrolling through every setting. If Precedence or MinPasswordLength does not match your plan, fix it now, before users start changing passwords under the wrong rules.

Let us walk through the fourth example: take the fuller policy for a second group, with -MinPasswordLength 16, -PasswordHistoryCount 24, -MaxPasswordAge "60.00:00:00", -MinPasswordAge "1.00:00:00", and -ReversibleEncryptionEnabled $false. The time values use a days, hours, minutes, seconds pattern, so 60.00:00:00 means 60 days, and 1.00:00:00 means 1 day. PasswordHistoryCount 24 means the last 24 passwords cannot be reused. This example shows why reading back matters: with many settings in one command, one typo in a time value or a count is easy to miss, and the read back table is where you catch it.

Let us walk through the fifth example: take Get-ADFineGrainedPasswordPolicy -Filter * | Select-Object Name, Precedence, MinPasswordLength. -Filter * means every policy, so this lists all PSOs at once, instead of one by name. Use it when you inherit a directory and need to see the whole picture: which policies exist, which precedence numbers are already taken, and where a new policy would fit. If two policies share a precedence number in this list, treat that as a problem to fix, because a tie is decided by an identifier you cannot explain to a user.

Let us walk through the sixth example: take Get-ADUserResultantPasswordPolicy -Identity "jdoe". This command answers the question that matters most: which policy actually applies to this one user, after precedence and group membership are worked out. The result may be a PSO, or it may be the default domain policy, if no PSO covers that user. If the result surprises you, check the groups that user belongs to, check which of those groups have a PSO, and compare their precedence numbers, starting with the lowest number, and remembering that a direct assignment beats a group assignment.

When to use it

When to use it, and when not to: use FGPP when one group genuinely needs stricter rules, such as admins or people with access to sensitive data. Do not use it for every small difference, because a pile of overlapping policies becomes hard to explain and hard to test. Do not assign FGPP to single users one by one, because that work grows fast and breaks when people change jobs, and do not forget precedence, because the policy you meant to win can lose to a weaker one with a smaller number. Keep the number of policies small, give each one a clear name and a written reason, and test on a small group first.

Safety warning, read this before you act: only create or assign password policies on a directory you manage, with permission, and tell the affected users before stricter rules take effect, because a very low lockout threshold can lock real users out after a few honest typos. Test with one test user first, check the resultant policy for that user, and only then roll the policy out to the whole group. A password policy is a security control, not a toy, and a rushed change can lock out the very people you meant to protect.

Worked examples

Read each example in order. Each one explains its parts, then shows what to look for in the output.

Syntax

Syntax
New-ADFineGrainedPasswordPolicy -Name <Name> -Precedence <Number> -MinPasswordLength <Number>

Example 1

Creates a stricter policy for admins: longer passwords, complexity on, lockout after 3 bad tries. -Name and -Precedence are required, -MinPasswordLength sets the shortest allowed password, -ComplexityEnabled $true requires a mix of character types, and -LockoutThreshold 3 locks after three bad tries.

Example 1
New-ADFineGrainedPasswordPolicy -Name "AdminPolicy" -Precedence 10 -MinPasswordLength 14 -ComplexityEnabled $true -LockoutThreshold 3

Illustrative output: Policy AdminPolicy created.

Example 2

Assigns the policy to the Admins group. -Identity names the policy, and -Subjects names the group. Members of that group now get the stricter rules, and future members pick them up automatically. Subjects must be users or global security groups, not organisational units.

Example 2
Add-ADFineGrainedPasswordPolicySubject -Identity "AdminPolicy" -Subjects "Admins"

Illustrative output: Policy AdminPolicy assigned to Admins.

Example 3

Get-ADFineGrainedPasswordPolicy reads back one policy. -Identity names the policy to read, using the same name as the creation example in the lesson. Select-Object keeps only Name, Precedence, and MinPasswordLength, so you can quickly check the priority number and the minimum length without scrolling through every setting.

Example 3
Get-ADFineGrainedPasswordPolicy -Identity "AdminPolicy" | Select-Object Name, Precedence, MinPasswordLength

Illustrative output: Name Precedence MinPasswordLength ---- ---------- ----------------- AdminPolicy 10 14

Example 4

Creates a fuller policy: at least 16 characters, the last 24 passwords cannot be reused, a password may live at most 60 days, and it cannot be changed again within 1 day. Time values use days, hours, minutes, seconds, so 60.00:00:00 means 60 days. -ReversibleEncryptionEnabled $false keeps passwords out of reversible storage, which is the safe normal choice.

Example 4
New-ADFineGrainedPasswordPolicy -Name "ServicePolicy" -Precedence 20 -MinPasswordLength 16 -PasswordHistoryCount 24 -MaxPasswordAge "60.00:00:00" -MinPasswordAge "1.00:00:00" -ReversibleEncryptionEnabled $false

Illustrative output: Policy ServicePolicy created.

Example 5

-Filter * means every policy, so this lists all password settings objects at once. Use it to see which precedence numbers are already taken, and to spot two policies sharing the same number, which you should fix because a tie is decided by an identifier you cannot explain.

Example 5
Get-ADFineGrainedPasswordPolicy -Filter * | Select-Object Name, Precedence, MinPasswordLength

Illustrative output: Name Precedence MinPasswordLength ---- ---------- ----------------- AdminPolicy 10 14 ServicePolicy 20 16

Example 6

Shows the policy that actually applies to one user, after group membership and precedence are worked out. Use it when the result surprises you: check the groups that user belongs to, find which of those groups have a policy, and compare precedence numbers, lowest first, remembering that a direct assignment beats a group assignment.

Example 6
Get-ADUserResultantPasswordPolicy -Identity "jdoe"

Illustrative output: Name Precedence MinPasswordLength ---- ---------- ----------------- AdminPolicy 10 14

Nothing on this page executes PowerShell code. The outputs above are illustrative only.

Common mistakes and troubleshooting

Read these before you try the examples, so you can spot the same problems in your own work.

  • Assigning FGPP to single users one by one, which becomes unmanageable. Assign to groups.
  • Forgetting precedence, so a weaker policy with a lower number wins over the stricter one you meant.
  • Creating a fine grained password policy and then forgetting to assign it to any group, so nobody actually gets the new rules and you wonder why passwords have not changed.
  • Trying to assign a policy to an organisational unit, a computer, or a distribution group, which a PSO cannot cover. Assign to users or to global security groups, and use a shadow group if your starting point is an organisational unit.
  • Giving two policies the same precedence number and hoping the right one wins. A tie is broken by an object identifier, so keep numbers distinct and spaced out, such as 10, 20, and 30.
  • Setting a very low lockout threshold without testing, then locking real users out after a few honest typos. Test on one test user first, and tell users before stricter rules take effect.
  • Assuming complexity alone makes a password strong, and forgetting length and history. A short complex password can still be weak, so set a solid minimum length and a history count alongside complexity.

Knowledge check

Knowledge check

When a user is covered by two FGPP policies, which one wins?

Pick one answer. Feedback appears right away, and you can try again.

Remember this and next step

Remember this: one domain policy for everyone, FGPP for a group that needs more, lowest precedence number wins among groups, a direct assignment beats a group assignment, and assign to groups, not to single users. Create it, assign it, read it back, and check one real user with the resultant policy command, and you will know exactly who gets the stricter rules, and why.

Next step: Network: adapters, IP addresses, and DNS