Skip to main content

GPO - Configure Default Password Policy Globals

Summary

The script modifies the properties of the default password policy for a domain. You can modify property values by using the cmdlet parameters and adjusting the values in the global variables.

Time Saved by Automation: 15 Minutes

Sample Run

Sample Run

Global Parameters

NameExampleRequiredDescription
LockoutDuration00:30:00TrueThis helps to lock the machine for the provided time window after multiple failed attempts.
LockoutThreshold5TrueThis helps to lock the machine after the provided failed attempt count.
LockoutObservationWindow00:20:00TrueThis helps to show information about how much time must pass before trying to log in again.
ComplexityEnabled1TrueThis indicates whether password complexity is enforced, including a combination of numbers, characters, and special conditions as per requirements.
ReversibleEncryptionEnabled0TrueThis indicates whether encryption is enabled or not.
MinPasswordLength10TrueThis specifies the minimum password length.
PasswordHistoryCount10TrueThis specifies the number of previous passwords that cannot be reused.
MaxPasswordAge90.00:00:00TrueThis ensures the password expiration date after a certain threshold is set.
MinPasswordAge01:00:00TrueThis ensures the minimum password age.

Process

  • This script will first retrieve the domain name.
  • The script will run PowerShell to modify the properties of the default password policy for a domain. You can modify property values by adjusting the values in the global variables.

Output

  • Script log