Removing Password Complexity Requirements from Windows Server 2008 Core

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
Advertisements

7 thoughts on “Removing Password Complexity Requirements from Windows Server 2008 Core

  1. 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.

  2. 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

  3. 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”

  4. 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s