
Active Directory Lab Setup - 102
A step-by-step guide for building your very own Cybersecurity Home Lab using VMware Workstation
TEARING DOWN the DOMAIN CONTROLLER
TEARING DOWN the DOMAIN CONTROLLERfunction WeakenPasswordPolicy(){
secedit /export /cfg C:\Windows\Tasks\secpol.cfg
(Get-Content C:\Windows\Tasks\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0").replace("MinimumPasswordLength = 7", "MinimumPasswordLength = 1") | Out-File C:\Windows\Tasks\secpol.cfg
secedit /configure /db c:\windows\security\local.sdb /cfg C:\Windows\Tasks\secpol.cfg /areas SECURITYPOLICY
rm -force C:\Windows\Tasks\secpol.cfg -confirm:$false
}
function StrengthenPasswordPolicy(){
secedit /export /cfg C:\Windows\Tasks\secpol.cfg
(Get-Content C:\Windows\Tasks\secpol.cfg).replace("PasswordComplexity = 0", "PasswordComplexity = 1").replace("MinimumPasswordLength = 1", "MinimumPasswordLength = 7") | Out-File C:\Windows\Tasks\secpol.cfg
secedit /configure /db c:\windows\security\local.sdb /cfg C:\Windows\Tasks\secpol.cfg /areas SECURITYPOLICY
rm -force C:\Windows\Tasks\secpol.cfg -confirm:$false
}Function: WeakenPasswordPolicy
Function: WeakenPasswordPolicyFunction: StrengthenPasswordPolicy
Function: StrengthenPasswordPolicySummary :
Last updated