When you log in to your Windows computer, you may get an error message like this:
Your password has expired and must be changed
In normal circumstances, it’s absolutely fine for Windows to remind you of password change after every specific number of days. But in some conditions, this practice should be disabled. A couple of scenarios could include the following:
- An administrator user should not have automatic expiration of password as this will lock you out of the computer if the password is not changed on regular basis.
- Another condition can be when you are accessing your computer remotely. If the password expires, you won’t be able to reset it remotely and will need physical access to the system.
In this tutorial, we will share three ways to set Windows local user account passwords to never expire. We will discuss:
- How to set Windows local user account passwords to never expire for all users.
- How to set Windows local user account passwords to never expire for a specific user.
If you are using Windows Home edition, you can enable Group Policy Editor for Windows 10 Home Edition.
Table of Contents
Configure Password Expiration using User Management
Windows makes it easier for us to manage local users of the system with Management Consoles.
Password Never Expires for a Specific User
Follow the steps below to set specific user account passwords to never expire:
-
Type in “lusrmgr.msc” in the Run Command box to open the Local Users and Groups management console.
-
Select “Users” from the left-hand menu.
-
Right-click the user in the middle pane for which you want to configure and select Properties.
-
Check the checkbox “Password never expires,” or simply press Alt + P keyboard shortcut.
-
Click Apply and Ok.
Password Never Expires for All Users
If you want that the password for all users in your system should never expire, follow the instructions below:
-
Open the Group Policy editor by typing in “gpedit.msc” in the Run Command box.
-
Navigate to the following using the left pane:
Local Computer Policy >> Computer Configuration >> Windows Settings >> Security Settings >> Account Policies >> Password Policy
-
Double-click the policy “Maximum password age.”
-
Set its value to “0.”
-
Click Apply and Ok.
Setting the maximum password age to zero will disable the password expiration feature for all users in Windows.
Configure Password Expiration using Command Prompt
If you are comfortable with the command line or want to do this remotely, you can use Windows commands for enabling and disabling the above-mentioned policies.
Password Never Expires for a Specific User using Command Prompt
Perform the following steps to configure a user account’s password to never expire:
-
Launch an elevated Command Prompt.
-
Get the name of users currently active on the system using this command:
net user
-
Now use the following cmdlet while replacing [Username] with the name of the account that you want to configure:
wmic useraccount where "Name='[Username]'" set PasswordExpires=false
Password Never Expires for All Users using Command Prompt
Perform the following steps to configure all user account passwords to never expire using Command Prompt:
-
Launch an elevated Command Prompt.
-
Run the following cmdlet:
net accounts /maxpwage:unlimited
Configure Password Expiration using PowerShell
You can achieve the same results using PowerShell.
Password Never Expires for a Specific User using PowerShell
-
Run the following command while replacing [Username] with the name of the user account that you wish to configure:
Set-LocalUser -Name "[Username]" -PasswordNeverExpires 1
Closing Words
Of course, your password should expire from time to time so you can change it, making your system more secure by not having the same password for decades. However, it also has its downsides, which we have discussed earlier in the post.
If your password expires while you are away, you will no longer be able to log into your system remotely. Moreover, if you are a system administrator, then you won’t be able to log back into your account without resetting your password.