Sub topic 13
Password, Lockout and Screen Lock Policies
This chapter covers the account policies that make passwords harder to guess, slow down attackers, and protect unattended sessions. It assumes you know the authentication factors from the previous chapters, can use the Windows command line, and understand how Windows accounts and groups work. The CompTIA A+ Core 2 (220-1102) exam tests these settings in scenario questions, so you need to know what each setting does and where to configure it.
Why Account Policies Exist
A password is a knowledge factor. It is only as strong as the attacker's cost of guessing it. Account policies set the rules that every account must follow, so security does not depend on each user making a good choice.
Three attacks drive most of the settings in this chapter:
- Brute force: the attacker tries many passwords, often with an automated tool. Offline attacks against stolen password hashes can try billions of guesses per second. Online attacks against a sign-in prompt are much slower.
- Dictionary attack: the attacker tries common words and known leaked passwords instead of every possible combination.
- Unattended session: a signed-in computer left alone gives anyone nearby the user's access. No password guessing is needed.
Each policy answers one of these problems. Complexity and length make guessing harder. Lockout makes online guessing slow. Screen lock closes the unattended-session gap.
Password Policies
A password policy defines what a valid password looks like and how long it can be used. The main settings are below.
| Setting | What it controls | Typical purpose |
|---|---|---|
| Minimum password length | Fewest characters allowed | Raises the number of possible guesses |
| Complexity requirements | Mix of character types (uppercase, lowercase, digits, symbols) | Blocks simple dictionary words |
| Maximum password age | Days before a password must change | Limits how long a stolen password stays useful |
| Minimum password age | Days before a user may change again | Stops users from cycling back to an old password |
| Enforce password history | Number of old passwords remembered | Prevents reuse of recent passwords |
| Expiration | Forces a change at the end of the maximum age | Same as maximum age; the exam often uses this word |
Length versus complexity
Length adds more strength than complexity. Each extra character multiplies the number of possible passwords. A 16-character passphrase such as three or four unrelated words is usually stronger and easier to remember than an 8-character string of symbols. Current guidance from NIST (SP 800-63B) favors longer passwords, checking against lists of known-breached passwords, and changing a password only when there is evidence of compromise. Many organizations still enforce periodic expiration, and the exam still lists it, so know both views.
Common errors
- Setting a short maximum age without a minimum age. Users then change the password several times in a row to get back to their favorite one, which defeats password history.
- Writing passwords on sticky notes because the rules are too strict. Overly complex rules push users toward insecure habits.
- Reusing one password across several sites. A breach at one site exposes the others.
- Leaving default passwords on routers, printers and administrator accounts.
Account Lockout Policies
A lockout policy disables an account after too many failed sign-in attempts. It targets online brute force and password guessing. Three settings work together:
- Account lockout threshold: the number of failed attempts allowed before the account locks.
- Account lockout duration: how long the account stays locked. A value of 0 means it stays locked until an administrator unlocks it.
- Reset account lockout counter after (the lockout window): how long Windows remembers failed attempts before the count returns to zero.
The net accounts command sets these on a local computer:
net accounts /lockoutthreshold:5 /lockoutduration:30 /lockoutwindow:30This locks an account for 30 minutes after five failed attempts within a 30-minute window. Run net accounts with no arguments to display the current settings.
Trade-offs and edge cases
- A low threshold helps attackers cause denial of service. If anyone can lock an account by typing wrong passwords, an attacker can lock out real users on purpose. Values of 5 to 10 are a common compromise.
- A threshold of 0 disables lockout. Windows then never locks the account, so guessing is unlimited.
- Lockout does not stop offline attacks. If an attacker steals the password hash or the drive, no sign-in prompt exists to count failures.
- The lockout duration must be at least as long as the reset window. Windows enforces this relationship when you set the values.
- Local accounts and domain accounts use different tools. The command above affects the local computer. In a domain, lockout settings come from Group Policy.
Screen Lock and Session Timeout Policies
A screen lock hides the desktop and requires the user to sign in again. It protects a session that is still open when the user walks away. Two features work together:
- Inactivity timeout: the screen locks automatically after a set idle time, commonly 5 to 15 minutes.
- Manual lock: the user presses Windows key + L to lock at once.
A lock screen is not the same as signing out. The user's programs and files stay open. A sign-out ends the session.
A screen saver with the option "On resume, display logon screen" gives the same effect on older systems. For the exam, remember that an idle timeout fails if it is too long, because the lock arrives after a passerby has already used the machine.
Where each setting lives
| Location | Used for |
|---|---|
| Local Security Policy (`secpol.msc`) | Password and lockout policy on a single computer |
| Local Group Policy Editor (`gpedit.msc`) | Local policy, including inactivity limits, on Pro, Enterprise and Education editions |
| Group Policy Management (domain) | The same settings pushed to many computers in an Active Directory domain |
| Settings > Accounts > Sign-in options | A user's own sign-in choices, such as PIN, and when Windows asks for sign-in again |
| Microsoft Intune or other MDM | Policy for managed phones, tablets and cloud-joined PCs |
Windows Home does not include gpedit.msc or secpol.msc. On Home you can still use net accounts for password and lockout settings.
How Group Policy Applies Settings
Group Policy is a Windows feature that applies configuration centrally. An administrator creates a Group Policy Object (GPO), links it to a site, domain or organizational unit (OU), and the settings reach every computer or user in that scope. This keeps rules consistent and removes the need to configure each machine by hand.
The diagram shows how one policy change reaches a workstation.
Workstations refresh policy at startup and sign-in, and about every 90 minutes afterward. To apply a change at once, run this command on the workstation:
gpupdate /forceTo see which policies actually apply to a computer, run gpresult /r. This helps when a setting does not take effect, for example because a policy with higher precedence overrides it.
Putting the Policies Together
A realistic baseline for an office combines all three controls:
- A minimum length of 12 or more characters, with a check against common passwords.
- Lockout after 5 failed attempts for 30 minutes.
- Screen lock after 10 minutes of inactivity, and a habit of pressing Windows key + L when leaving the desk.
- Multifactor authentication on top, so a guessed password alone is not enough.
Troubleshooting scenarios
- A user says their account is locked, and they did not mistype anything. Check for a saved old password on a phone, mapped drive or scheduled task that keeps retrying. Then unlock the account and update the stored credential.
- A policy change does not apply. Run
gpupdate /force, thengpresult /rto confirm the right GPO reaches the computer. Also check that the setting is in a computer policy or a user policy as appropriate. - A user cannot reuse a password they want. Password history or minimum age is blocking it. This is intended behavior.
- A kiosk or shared workstation needs to stay unlocked. Use a restricted account and physical controls rather than disabling the lock on a normal account.
Exercise
An administrator sets the account lockout threshold to 3 attempts with a duration of 0. Users start calling because they cannot sign in after a typing mistake. Explain what a duration of 0 does and name one change that reduces the calls without removing lockout.
Show answer
A duration of 0 keeps the account locked until an administrator unlocks it manually. To reduce calls, set a timed duration such as 15 or 30 minutes so accounts unlock automatically, and raise the threshold to about 5 to 10 attempts. Lockout stays active against guessing.
Exercise
A user changes their password five times in a row so they can go back to their old one. Which two settings stop this, and what does each do?
Show answer
Enforce password history remembers a set number of previous passwords and rejects them. Minimum password age stops the user from changing the password again for a set number of days, so they cannot cycle quickly through the history.
Exercise
A company has Windows 11 Pro laptops that are not joined to a domain. You must set a lockout threshold of 5 on one laptop. Give a command and a graphical tool that can do it.
Show answer
Run net accounts /lockoutthreshold:5 from an elevated prompt, or open Local Security Policy (secpol.msc) and set Account lockout threshold under Account Policies.