- 1 year ago
How to enable local Account Lockout Policies through PowerShell?
To enable local Account Lockout Policies through PowerShell, you can use the Set-LocalSecurityPolicy
cmdlet. Here's an example of how to enable the Account Lockout Policies:
Open PowerShell with administrative privileges.
Run the following command to enable the Account Lockout Policies:
powershellSet-LocalSecurityPolicy -PolicyAllSev 3 -AccountLockoutPolicy -EnableAccountLockout
This command sets the Account Lockout Policy to the default values:
- Account lockout threshold: 3 invalid logon attempts
- Account lockout duration: 30 minutes
- Reset account lockout counter after: 30 minutes
You can customize these values by specifying the desired thresholds and durations.
After running the command, the Account Lockout Policies will be enabled on the local machine.
Note that the Set-LocalSecurityPolicy
cmdlet is available on Windows Server 2016 and later versions, and Windows 10 version 1607 and later versions.
Make sure to run the PowerShell command with administrative privileges to have the necessary permissions to modify the security policies.