Set the local password policy on Windows (net accounts)
Adjust minimum password length, maximum password age and password history for the local machine with the forgotten net accounts switches.
Run net accounts /minpwlen:12 /maxpwage:90 /uniquepw:5 to enforce a 12-character minimum, 90-day rotation and 5-password history.
01Command
Command
$ net accounts /minpwlen:12 /maxpwage:90 /uniquepw:502What it does
Plain 'net accounts' with no arguments prints the current policy — most people never discover this because they only know 'net user'. These settings are the machine's local password and lockout policy, relevant on workgroup systems and servers outside domain GPO reach. Lockout knobs live in the same command: /lockoutthreshold, /lockoutduration and /lockoutwindow form the classic account-lockout triad.
03Risk
!Warning: On domain-joined machines the domain policy overrides local settings — changes here will silently have no effect on domain accounts.
04Undo
Undo
$ net accounts /minpwlen:805Sources
- Net accounts | Microsoft LearnEvidence: Microsoft documents net accounts with parameters such as /minpwlen (minimum password length), /maxpwage and /uniquepw to manage the local password and lockout policy.
Last verified: 2026-09-17 · Category: Security & Privacy