How to Modify the Password Policies for Windows Server by Using Commands

The Password complexity is a Local Policy setting named “Passwords must meet complexity requirements” under Computer Configuration/Windows Settings/Security Settings/Account Policies/Password Policy.

In a Server Core installation, there is no graphical user interface to set this policy.
Instead, use secedit to import and export the security settings from a Full Installation of Windows Server 2008 and later versions.

  1. First export your security configuration using the following command:

    secedit /export /cfg C:\securityconfig.cfg
  2. Then open notepad.exe and edit the C:\securityconfig.cfg file.
    Under [System Access] you should find PAssword complexity = 1
    Change the value to 0 and save the file.
  3. You can also modify policies like Minimum Password Age, Lockout Duration, etc.
  4. Then fire up the next command to import the configuration:

    secedit /configure /db C:\Windows\security\new.sdb /cfg C:\securityconfig.cfg /areas SECURITYPOLICY