Active Directory - How to Test Password and Account Lockout Policies


Setting up proper password and account lockout policies is a key part of hardening an Active Directory (AD) environment. In this hands-on guide, we’ll walk through how to configure these policies using Group Policy and then test them with a real user account.
Prerequisites
Before you begin, make sure you have the following:
A Windows Server domain controller (e.g., mcnairtech.local)
Active Directory and DHCP roles already installed
A domain-joined client workstation for testing
Step 1: Configure Password and Lockout Policies
Open Group Policy Management Console (
gpmc.msc
)Right-click your domain (
mcnairtech.local
) and choose Create a GPO in this domain and link it here. Name it something like:Domain Password Policy
Right-click the new GPO and select Edit
Navigate to:
Computer Configuration > Policies > Windows Settings > Security Settings > Account Policies
Under Password Policy, set:
Minimum password length: 12 characters
Password must meet complexity requirements: Enabled
Enforce password history: 24 passwords remembered
Under Account Lockout Policy, set:
Account lockout threshold: 5 invalid logon attempts
Account lockout duration: 15 minutes
Reset account lockout counter after: 15 minutes
- Close the editor. Ensure the GPO is linked to the domain root.
Step 2: Force the Policy to Apply
Group Policy refreshes on a schedule, but you can apply it immediately:
Open Command Prompt as Administrator
Run: gpupdate /force
- Restart your domain controller to ensure all settings apply
If you have a domain-joined client, restart that too.
Step 3: Create a Test User
Open Active Directory Users and Computers (
dsa.msc
)Right-click the
Users
container or a test OU, then choose New > User
Create a user:
Full name: Test User
Username: testuser
Password: Try a weak one like
pass123
(it should be rejected)Use a valid password like
McnairTech!2024
to proceed
Step 4: Test the Account Lockout Policy
On a domain-joined PC or the domain controller:
Try logging in as
testuser
with the wrong password 5 timesYou should see a message:
"The referenced account is currently locked out and may not be logged on to."
Step 5: Verify the Lockout in Active Directory
Open Active Directory Users and Computers
Right-click the
testuser
account > Properties > Account tabYou should see the checkbox for "Unlock account" unchecked
To unlock it manually:
check the box and click OK
Or wait for the configured lockout duration to expire
Optional: Verify Policy with GPResult
To confirm the policy applied successfully:
Run:
gpresult /h report.html
Open report.html
in a browser and scroll to Computer Settings > Account Policies.
Conclusion
With these steps, you’ve enforced and verified password complexity, length, and account lockout policies using Group Policy in Active Directory. This foundational task is essential in any secure Windows domain.
Stay tuned for more AD and GPO hands-on guides!
Subscribe to my newsletter
Read articles from JMcNairTech directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
