How to Set Password Expiry in Windows 10 and Windows 11

Setting a password expiry period in Windows 10 and Windows 11 is an essential security measure that prompts users to change their passwords after a set amount of time. This is particularly important for organizations or users who need to follow strict security protocols. Let's take a look at how to do this step by step.

1. Setting Password Expiry via Local Security Policy

To do this, you will need to use the Local Security Policy (secpol.msc). This application is available only in Windows 10 Pro, Enterprise, and Education editions, as well as Windows 11 Pro and higher.

  1. Press Win + R to open the Run dialog box. Type secpol.msc and press Enter.
  2. The Local Security Policy window will open. In the left pane, navigate to Account PoliciesPassword Policy.
  3. In the right pane, find the setting Maximum password age and double-click it.
  4. In the window that appears, set the desired number of days (from 1 to 999) after which the password will need to be changed. Click OK.

2. Setting Password Expiry via Command Prompt (for all Windows versions)

If you're using Windows 10 Home or Windows 11 Home, you won't have access to the Local Security Policy. However, you can use the Command Prompt to set a password expiry for specific users.

  1. Press Win + X and select Command Prompt (Admin) or PowerShell (Admin).
  2. Enter the following command to change the password expiration period:
net accounts /maxpwage:30

This command will set the password expiry to 30 days. If you want to change it to a different number of days, just replace "30" with the number you prefer. To set the password to never expire, use the following command:

net accounts /maxpwage:unlimited

3. Checking and Configuring via Group Policy (for Pro and Enterprise versions)

In addition to the Local Security Policy, you can also use Group Policy to change the password expiry settings. This option is also available only in the Pro or Enterprise editions of Windows.

  1. Press Win + R and type gpedit.msc to open the Group Policy Editor.
  2. Navigate to Computer ConfigurationAdministrative TemplatesSystemPasswords.
  3. Double-click on the setting Maximum password age and set the desired value.