As per this article, using PowerShell or cmd, I want to force a user to have specific password requirements. I tried editing a config file in secedit
.
secedit /export /cfg c:\secpol.cfg
$min_pass_regex = "MinimumPasswordLength = \d+"
$min_pass_length = 10
$min_pass_requirement = "MinimumPasswordLength = $($min_pass_length)"
(gc C:\secpol.cfg).replace("RequireLogonToChangePassword = 0", "RequireLogonToChangePassword = 1") | Out-File C:\secpol.cfg
(gc C:\secpol.cfg).replace("PasswordComplexity = 0", "PasswordComplexity = 1") | Out-File C:\secpol.cfg
(gc C:\secpol.cfg) -replace $min_pass_regex, $min_pass_requirement | Out-File C:\secpol.cfg
cat C:\secpol.cfg
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
However, the user gets no warning to create a more secure password, even after restarting. How can I enforce this policy?