-->

Temporary Lock Windows PC Using Command Prompt

Temporary Lock Windows PC Using Command Prompt

 If you are worried that someone is constantly trying to guess your Windows password, you can set Windows to temporarily block sign-in after several failed sign-in attempts.


Setting your PC to temporarily block sign-in after a number of failed attempts can help prevent break-in attempts, but this only works if you're using a local user account. Here's how to set it up:


Set Limit Sign In Limit Using Command Prompt


1. Right-click on the Start menu (or press Windows + X on your keyboard) to open the Power User menu, then click “Command Prompt (Admin).”


256x580xsil_a


2. At the prompt, type the following command and then press Enter:

net accounts


3. This command lists the current password policy, which by default will say “threshold Lockout: Never”, which means that your account will not lock out no matter how many times the wrong password is entered.


585x300xsil_ab


4. You will start to set the number of times failed to sign in before the temporary lock out. You can set any number you like, but we recommend at least three. Just type the following command, replacing the number at the end with the number you want.

net accounts /lockoutthreshold:3

 585x202xsil_b-1


5. Now, you will set the lockout duration. This amount determines how long (in minutes) the account will be locked if the sign-in limit fails to be reached. We recommend 30 minutes, but you can set as many times as you like.

net accounts /lockoutduration:30

 585x202xsil_c


6. And next, you will set the window lockout. This amount determines how long the grace period for resetting, if the actual sign-in limit is not reached. So for example, you set the window lockout to 30 minutes and the sign-in limit is 3 times. You can enter 2 times the wrong password, wait 30 minutes, and then you will have 3 times the chance to try again. Set the window lockout with the following command, replacing the number at the end with the number of minutes you want:

net accounts /lockoutwindow:30

 585x202xsil_d-pn


7. Once done, you can use the net accounts command again to review your settings. They will look like the settings below, depending on what you choose:


585x294xsil_e


Now you're done! Your account will automatically prevent people from logging in if the wrong password is entered too many times. On the login screen, there is no indication that the account will be locked out if it reaches the sign-in limit. Everything will look like normal.


If you wish to disable this setting, then re-enter the administrative command prompt and set the account threshold to 0 using the following command:

net accounts /lockoutthreshold:0

Related Posts