Set Account Lockout Policy (net accounts)
Automatically lock the account for 30 minutes after 5 wrong password attempts.
01Command
$ net accounts /lockoutthreshold:5 /lockoutduration:30 /lockoutwindow:3002What 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
04Undo
$ net accounts /lockoutthreshold:005Sources
- net - Windows CMDEvidence: Covers the net accounts options including /lockoutthreshold, /lockoutduration and /lockoutwindow for configuring account lockout.
Last verified: 2026-09-18 · Category: Security & Privacy
06Related solutions
Understand PowerShell's execution policy scopes and set the one that lets you run your own local scripts without gutting the security model.
Two-step command sequence that makes you the owner of a locked file tree and grants yourself full control — the standard fix for 'Access is denied' on old profiles and OS reinstall leftovers.
Built-in Windows command to compute MD5, SHA1 or SHA-256 hashes of any file.