Use this PowerShell script if you need to remove Password Complexity Requirements from Windows Server 2008 Core:
secedit /export /cfg c:\new.cfg ${c:new.cfg}=${c:new.cfg} | % {$_.Replace('PasswordComplexity=1', 'PasswordComplexity=0')} secedit /configure /db $env:windir\security\new.sdb /cfg c:\new.cfg /areas SECURITYPOLICY del c:\new.cfg
Thank you SO much for posting this. I’ve been going nuts trying to get this turned off.
i’ve tried secedit manually and this script and multiple text editors without any luck. Is anyone else having problems. I’m applying the latest updates now.
Maybe some formating problem? Try again. It should be in one line.
Hello Konstantin, thank for your tip.
On a 2008 Server, (not core version) it seems it doesn’t work and I don’t understand why.
Here is the error message :
PS C:\Users\Administrator\Documents> secedit /export /cfg c:\new.cfg ${c:new.cfg}=${c:new.cfg} | % {$_.Replace(‘PasswordComplexity=1’, ‘PasswordComplexity=0’)} secedit /configure /db $env:windir\security\new.sdb /cfg c:\new.cfg /areas SECURITYPOLICY del c:\new.cfg
ForEach-Object : Cannot bind parameter ‘Process’. Cannot convert the “secedit” value of type “System.String” to type “System.Management.Automation.ScriptBlock”.
At line:1 char:62
+ secedit /export /cfg c:\new.cfg ${c:new.cfg}=${c:new.cfg} | % <<<< {$_.Replace('PasswordComplexity=1', 'PasswordComplexity=0')} secedit /configure /db $env:windir\security\new.sdb /cfg c:\new.cfg /areas SECURITYP
OLICY del c:\new.cfg
+ CategoryInfo : InvalidArgument: (:) [ForEach-Object], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.ForEachObjectCommand
Do you know why ? I am not enough skilled to understand all of your command/script. (for example, I don't understand the "${c:new.cfg}=${c:new.cfg}". I suppose the "%" is the equivalent of a "for each" ?
Thank you again
Thanks for the script! Random note when I was using it on Windows Server 2008 R2 SP1:
The secedit export had spaces around the equals (=) sign, and I had to change “PasswordComplexity=1” to “PasswordComplexity = 1”
The below worked for me.
# works on Microsoft Windows Server 2008 #carriage return
secedit /export /cfg c:\new.cfg #carriage return
start-sleep -s 5 #carriage return
((get-content c:\new.cfg) -replace (‘PasswordComplexity = 1’, ‘PasswordComplexity = 0’)) | Out-File c:\new.cfg #carriage return
secedit /configure /db $env:windir\security\new.sdb /cfg c:\new.cfg /areas SECURITYPOLICY #carriage return
Rename-Item c:\new.cfg c:\new.cfg.txt #carriage return
write-host “That’s all folks!” #carriage return
[…] https://vlasenko.org/2011/04/27/removing-password-complexity-requirements-from-windows-server-2008-co… […]