Windows: How to disable expiring passwords

By default, windows server has a max password age = 42 days which requires a new password every 42 days.

For internal server this can be a pain...

Run the following two terminal commands to disable:
1. <strong>wmic UserAccount where Name='Administrator' set PasswordExpires=False</strong>
2. <strong>net accounts /maxpwage:0</strong>

By default, item 1 is likely already set, but it's good practice to verify.

<strong>Note:</strong> This should <strong>NOT</strong> be done for production server.

Manual/GUI Steps:
1. lusrmgr.msc
2. Users / Administrator / Password never expires: checked
Manual/GUI Steps: 
1. secpol.msc
2. Accounts Policies / Password Policy / Maximum password age:0

Verify via command line:

<strong>wmic UserAccount where Name='Administrator' get PasswordExpires</strong>
PasswordExpires
FALSE
------------------------------------------
<strong>net accouints | findstr Max</strong>
Maximum password age (days): Unlimited