There are two ways you can lock someone out of your PC, through Local Security Policy or Command Prompt. Local Security Policy is only available on the following Windows 7 versions – Professional, Ultimate and Enterprise.
For Windows 7 (Professional, Ultimate and Enterprise only) using Local Security Policy:
Navigate to the start menu and start to type Local Security Policy. Press enter to continue.
Local Security Policy opens. Navigate to Security Settings\Account Policies\Account Lockout Policy
Double click on Account lockout threshold.
The Account Lockout Threshold Properties dialog box opens. Enter in the amount of invalid login attempts you want to allow before someone is logged out. For our example, we choose 5. Click OK to save changes.
Windows will prompt you to accept suggested settings for Account lockout duration and Reset account lockout counter. The default setttings suggested are 30 minutes. For our example, we accept the recommended times and click OK.
As a result, the next time someone tries to login to your computer but fails to enter in the correct password 5 times, they are promptly locked out for approximately 30 minutes.
For Windows 7 (all versions) using Command Prompt:
Click Start and type CMD in the search bar. Right click CMD and select Run as administrator.
Command Prompt opens. Type in the following command:
Your current password policy will be displayed. Take note that the Lockout threshold settings is Never. Furthermore, the Lockout duration (minutes) and Lockout Oberservation Window (minutes) are both 30.
For our example, we want to amend the lockout threshold to 5 attempts. So we type in the following:
net accounts /lockoutthreshold:5
The Account Lockout Duration and Reset Account Lockout Counter’s default settings are 30 minutes. If you want to change the time for both to, let’s say, 40 minutes (it is best if both have the same time to avoid any issues), enter in the following:
net accounts /lockoutduration:40
net accounts /lockoutwindow:40
Once complete, type in net accounts to review your settings before exiting CMD.
As a result, the next time someone tries to login to your computer but fails to enter in the correct password 5 times, they are promptly locked out for approximately 40 minutes.