I recently encountered a problem creating new logins with SQL Server. Something that has worked for years suddenly stopped with the following error:
Password validation failed. The password does not meet Windows policy requirements because it is too short.
Since SQL Server was using Windows local security policy I went and checked that at Security Settings > Account Policies > Password Policy in Local Security Policy (available under Administrative Tools in Control Panel or by opening secpol.msc). As expected, these contained setting that I was not expecting, which were probably changed from the network by a system administrator.
However, I wanted to be able to enter shorter passwords, like 8 characters instead of 10, but this was disabled. Even if I was running as administrator, the option of changing this was disabled.
It is however still possible to modify these settings even if you cannot do it from the management console. You can do it from a command prompt as administrator.
- Open a command prompt running as administrator
- Run the following command to export the settings to a file. In my example, the target path is c:\temp\local.cfg, but it can be anything.
Shell1secedit /export /cfg c:\temp\local.cfg
- Edit the file with notepad or another editor. The file is an INI file with sections and key-value pairs. The password settings are available under the [System Access] section. For changing the minimum length of the passwords modify the MinimumPasswordLength key.
- Save the file and run the following command to import the settings from the modified file.
Shell1secedit /configure /db %windir%\security\local.sdb /cfg c:\temp\local.cfg /areas SECURITYPOLICY
- Close and open the Local Security Policy console again and check the settings.