Set Account Lockout Policy (net accounts)

Automatically lock the account for 30 minutes after 5 wrong password attempts.

WindowspolicyaccountssecurityMedium risk
Run net accounts /lockoutthreshold:5 /lockoutduration:30 /lockoutwindow:30 in an admin Command Prompt.

01Command

Command
$ net accounts /lockoutthreshold:5 /lockoutduration:30 /lockoutwindow:30

02What it does

Without lockout, anyone can keep guessing your password forever. /lockoutthreshold:5 disables the account after 5 bad attempts, /lockoutduration:30 keeps it locked for 30 minutes, and /lockoutwindow:30 counts the failed attempts within a 30-minute window. net accounts with no switches shows the current policy.

03Risk

RiskMedium risk
RequirementsRun Command Prompt as administrator. Values: threshold = wrong attempts, duration/window in minutes.
!Warning: Forgotten passwords become worse: after lockout you must wait out the timer (or unlock via another admin account), so don't set the threshold too low for your own habits.

04Undo

Undo
$ net accounts /lockoutthreshold:0

05Sources

  • net - Windows CMD
    SS64 · technical · 2026-09-17
    Evidence: Covers the net accounts options including /lockoutthreshold, /lockoutduration and /lockoutwindow for configuring account lockout.

Last verified: 2026-09-18 · Category: Security & Privacy

06Related solutions