none
disabling password complexity via powershell RRS feed

  • Question

  • hi friends

    i spent lots of time searching entire internet to find a command or script (powershell, cmd, VB, registry...) to be able to disable password complexity. there are few solutions which none of them works.

    i wonder how what a pity if we can't do such simple thing in Microsoft windows

    i really need that because i have created a script which contains many lines which automates windows customization which i always need in my classrooms for testing & teaching purposes

    thanks for any help
    • Edited by john.s2011 Wednesday, October 22, 2014 7:24 PM
    Wednesday, October 22, 2014 7:17 PM

Answers

  • Hi John,

    To disable the group policy "Passwords must meet complexity requirements", please tey the cmd "secedit", and try the script below:

    secedit /export /cfg c:\secpol.cfg
    (gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg
    secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
    rm -force c:\secpol.cfg -confirm:$false
    
     

    Refer to:

    Modify Local Security Policy using Powershell

    If there is anything else regarding this isue, please feel free to post back.

    Besat Regards,

    Anna Wang

    Saturday, October 25, 2014 4:53 PM
    Moderator
  • Hi John,

    Please copy and paste the script I posted, and post the screenshot, this is my result which ran without issue on Windows 8:

    If there is anything else regarding this isue, please feel free to post back.

    Besat Regards,

    Anna Wang

    HI again Anna

    no again didn't work. but this Advice from jrv  worked:

    Do not use the Replace method. This one does exist on strings but not on arrays. Get-Content gives you an array of strings. The -replace operator should work as this one is designed in a way to work on single objects as well as arrays.

    Thursday, October 30, 2014 11:18 AM

All replies

  • Hi John,

    To disable the group policy "Passwords must meet complexity requirements", please tey the cmd "secedit", and try the script below:

    secedit /export /cfg c:\secpol.cfg
    (gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg
    secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
    rm -force c:\secpol.cfg -confirm:$false
    
     

    Refer to:

    Modify Local Security Policy using Powershell

    If there is anything else regarding this isue, please feel free to post back.

    Besat Regards,

    Anna Wang

    Saturday, October 25, 2014 4:53 PM
    Moderator
  • Hi John,

    To disable the group policy "Passwords must meet complexity requirements", please tey the cmd "secedit", and try the script below:

    secedit /export /cfg c:\secpol.cfg
    (gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg
    secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
    rm -force c:\secpol.cfg -confirm:$false
    
     

    Refer to:

    Modify Local Security Policy using Powershell

    If there is anything else regarding this isue, please feel free to post back.

    Besat Regards,

    Anna Wang

    Hi Anna

    thanks a lot for you interesting & helpful guide. that gave me new view.

    unfortunately when i run your script, i end up with this error:

     

    Saturday, October 25, 2014 8:19 PM
  • Hi John,

    Please copy and paste the script I posted, and post the screenshot, this is my result which ran without issue on Windows 8:

    If there is anything else regarding this isue, please feel free to post back.

    Besat Regards,

    Anna Wang

    Monday, October 27, 2014 2:24 AM
    Moderator
  • Hi John,

    Please copy and paste the script I posted, and post the screenshot, this is my result which ran without issue on Windows 8:

    If there is anything else regarding this isue, please feel free to post back.

    Besat Regards,

    Anna Wang

    HI again Anna

    no again didn't work. but this Advice from jrv  worked:

    Do not use the Replace method. This one does exist on strings but not on arrays. Get-Content gives you an array of strings. The -replace operator should work as this one is designed in a way to work on single objects as well as arrays.

    Thursday, October 30, 2014 11:18 AM
  • Hi John,

    Thanks for your solution =)

    Monday, November 3, 2014 11:46 AM
    Moderator
  • Hi John,

    Thanks for your solution =)

    you are welcome  ;-)

    best regards

    Tuesday, November 4, 2014 6:55 AM
  • It would be very helpful if the "solution" were made clear in this thread!

    Thank you!

    Friday, April 19, 2019 3:02 PM
  • I agree totally. So many of these 'solutions' have convoluted paths to get to the eventual answer and we, as people trying to resolve our issues using these forums are left hanging trying to figure it out from scratch. MS could do itself a HUGE service by having a summary of the correct steps to resolve a forum question. 

    PEACE

     

    Not

    Friday, April 19, 2019 3:42 PM