Skip to content

Instantly share code, notes, and snippets.

@ducke
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ducke/dc4241e91fdfeafd816c to your computer and use it in GitHub Desktop.
Save ducke/dc4241e91fdfeafd816c to your computer and use it in GitHub Desktop.
disable password complexity
#Requires -Version 3.0
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
@ducke
Copy link
Author

ducke commented Feb 23, 2015

.replace requires Powershell Version 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment