How to temporarily lock your PC after a given number of incorrect password entries in Windows 7 using the command prompt

Date: February 19th, 2011
Author: Mark Kolin

Are you worried that your Windows 7 login password is easy to guess and that it is possible to crack it only after a few attempts? Well if you are I have two things to say to you. First, change your password. I know you have probably heard it a thousand times, but having a “smart” password is essential these days. You won’t feel comfortable if a thousand other people unlocked their front doors with a key identical to the one you use for your own front door, would you?
The second thing I have to say is, why don’t you at least lock your PC after a few incorrect entries? Surely this will make the password guessing process a lot longer.
Note: It is a good idea to have a second administrator account which you can use to unlock your PC. Just in case someone decides to do a trick on you.
Note: In case of physical access to your PC this will not slow down the use of System Rescue CD, Ultimate Boot CD or Ubuntu Live CD for resetting your password.

First, open the Command Prompt under Administrator Mode.

To do that, open the Start menu, type cmd in the search box:

How to temporarily lock your PC after a given number of incorrect password entries in Windows 7 using the command prompt

Right-click on cmd.exe and select Run as administrator:

How to temporarily lock your PC after a given number of incorrect password entries in Windows 7 using the command prompt

The command prompt will open:

How to temporarily lock your PC after a given number of incorrect password entries in Windows 7 using the command prompt

Now in the command prompt enter net accounts and press Enter:

How to temporarily lock your PC after a given number of incorrect password entries in Windows 7 using the command prompt

Here you can view your system’s security policy. As you can see the value of Lockout threshold is Never.
Now we will modify this.
Note: From this moment on make sure to complete the full tutorial, or you can permanently lock yourself out.
To change the amount of incorrect password entries required for a lockout use the following command:
net accounts /lockoutthreshold:<number>

Where <number> is the amount of incorrect entries. If it is 0 then this feature is disabled. Now we will set it to 3:

How to temporarily lock your PC after a given number of incorrect password entries in Windows 7 using the command prompt

The following commands:
net accounts /lockoutduration:<minutes>
net accounts /lockoutwindow:<minutes>
Specify the duration of the lockout and the time needed until the incorrect password entries counter is reset. After you are done you can enter net accounts to check if everything is OK:

How to temporarily lock your PC after a given number of incorrect password entries in Windows 7 using the command prompt

VN:F [1.9.18_1163]
Rating: 0.0/10 (0 votes cast)

One Response to “How to temporarily lock your PC after a given number of incorrect password entries in Windows 7 using the command prompt”

  • I like what you guys are up also. Such smart work and reporting! Carry on the superb works guys Ive incorporated you guys to my blogroll. I think it will improve the value of my site :)

Leave a Reply