Skip to content

Instantly share code, notes, and snippets.

@flatlinebb
Created November 27, 2019 03:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flatlinebb/a5bef45add52252485fdf8fa11f17a35 to your computer and use it in GitHub Desktop.
Save flatlinebb/a5bef45add52252485fdf8fa11f17a35 to your computer and use it in GitHub Desktop.
Set user password to never expire in command line
Password never expire for a specific user using command-line
Open command-prompt with administrative privileges and run the following command sequence:
Get the name of users currently active on the system using this command: net accounts
Run the following command:
wmic useraccount where �Name=�itechticsuser'� set PasswordExpires=false
Replace �itechticsuser� with the name of user you want to configure.
Password never expire for all users using command-line
Open command-prompt with administrative privileges and run the following command:
net accounts /maxpwage:unlimited
3 Ways To Set Windows Local User Account Passwords To Never Expire 1
Configure password expiration using PowerShell
You can achieve the same results using PowerShell
Password never expire for a specific user using PowerShell
Press Windows Key + X + A keyboard shortcut sequence to open PowerShell with administrative privileges.
Run the following command:
Set-LocalUser -Name �itechticsuser� -PasswordNeverExpires 1
Replace itechticsuser with your desired username.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment