How to Automatically lock the computer when login fails

This post shows you how to automatically lock your computer when login fails.

Your computer automatically locks after three incorrect password attempts to prevent unauthorized access. To do this you can follow these instructions:

1. Change Local Security Policy

This Local Security Policy is only integrated on Windows 7 and Vista in Pro, Enterprise and later versions. If you use Start, Home OS... you will have to use Command Prompt. You can automatically lock your device by editing it in the Local Security Policy section.

To open Local Security Policy, click the Start menu and then type Local Security Policy in the search box, then click Local Security Policy.

Local Security Policy

Local Security Policy window appears, click Account Policies on the left, then click Account Lockout Policy.

By default, when you enter wrong password, your account will be automatically locked immediately. To change this, double-click Account lockout threshold on the right side of the dialog box.

account lockout threshold properties

A new window appears and you can change the number of times you have entered the wrong password. Here I choose to allow the wrong password 3 times and then click OK to complete the changes.

Besides, Windows also allows you to choose the time to unlock temporary user accounts. You can change these settings at Account lockout duration and Reset account lockout counter.

The default is after 30 minutes your computer will automatically open again, click OK to save your changes to the settings. Now your computer will automatically lock in 30 minutes when you enter the wrong password 3 times.

2. Change password settings in the Command Prompt

To open Command Prompt, go to the Start menu, type Command Prompt (CMD) in the search box, then right-click Command Prompt and select Run as administrator.

cmd

Alternatively, you can use the Windows key + R to type cmd in the Open section of the Run dialog box, and then click OK.

command promptAt the Command Prompt window, enter net accounts command, the system will list you the password related settings. In which the lockout threshold: Never. This means that your computer will never be locked if you enter the wrong password n ​​times.

net accountsTo adjust the number of times you can enter the wrong password 3 times you enter the command net accounts /lockoutthreshold:3 then press Enter.
In addition, it also allows the computer to close and automatically reopen after 30 minutes when you enter the order in the order net accounts /lockoutduration:30 and net accounts /lockoutwindow:30.

You can double check the settings by re-entering the net accounts command on the Command Prompt.