Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Account lockout policy

07 Sep 2015   #1
NagarajMadyasth

WINDWS 64
 
 
Account lockout policy

I need to read the individual value before setting new values for bellow attributes
Account lockout duration/threshold/reset account lockout counter
Please let us know how to achive the same.
net accounts /lockoutthreshold:X
net accounts /lockoutwindow:X
net accounts /lockoutduration:X


My System SpecsSystem Spec
.
07 Sep 2015   #2
Ztruker

Windows 10 Pro X64
 
 

Just type in net accounts from a Elevated Command Prompt.

Code:
C:\WINDOWS\system32>net accounts
Force user logoff how long after time expires?:       Never
Minimum password age (days):                          0
Maximum password age (days):                          42
Minimum password length:                              0
Length of password history maintained:                None
Lockout threshold:                                    Never
Lockout duration (minutes):                           30
Lockout observation window (minutes):                 30
Computer role:                                        WORKSTATION
The command completed successfully.
My System SpecsSystem Spec
08 Sep 2015   #3
NagarajMadyasth

WINDWS 64
 
 

Quote   Quote: Originally Posted by Ztruker View Post
Just type in net accounts from a Elevated Command Prompt.

Code:
C:\WINDOWS\system32>net accounts
Force user logoff how long after time expires?:       Never
Minimum password age (days):                          0
Maximum password age (days):                          42
Minimum password length:                              0
Length of password history maintained:                None
Lockout threshold:                                    Never
Lockout duration (minutes):                           30
Lockout observation window (minutes):                 30
Computer role:                                        WORKSTATION
The command completed successfully.
****************
Thanks for your replay...
Above context i need to read indiviual value by filtering the attribue using "find" command.
Do we have any direct command to read individual attribute ?
My System SpecsSystem Spec
.

08 Sep 2015   #4
GokAy

Windows 7 Ultimate x64 SP1
 
 

Try:
Code:
net accounts |findstr /c:"what_to_search_for" /i
Example:
Code:
net accounts |findstr /c:"Force" /i
Force user logoff how long after time expires?:       Never
Or to output to a file
Code:
net accounts |findstr /c:"Computer" /i>>%userprofile%\desktop\output.txt
My System SpecsSystem Spec
08 Sep 2015   #5
Ztruker

Windows 10 Pro X64
 
 

This works to get the 3 Lockout values:

Code:
C:\WINDOWS\system32>net accounts |findstr /c:"Lockout" /i
Lockout threshold:                                    Never
Lockout duration (minutes):                           30
Lockout observation window (minutes):                 30
If you redirect the output to a file you can then use a FOR loop to read each line and do stuff with it.
My System SpecsSystem Spec
09 Sep 2015   #6
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Quote   Quote: Originally Posted by NagarajMadyasth View Post
[...] Do we have any direct command to read individual attribute ?
There is no direct command to read these settings. The ideal way would be to read the registry items for them, but unfortunately these settings are not actually stored in registry keys.

You're going to have to retrieve these settings using pure Batch.
Code:
@echo off
goto :main

:trim_leading_spaces VariableName
setlocal
	call set "_=%%%~1%%"
	set _=%_:"=%
	:trim_leading_spaces__while
	if "%_:~0,1%"==" " ( set "_=%_:~1%"& goto :trim_leading_spaces__while)
endlocal & set "%~1=%_%"
goto :eof

:main
for /f "tokens=1,2 delims=:" %%I in ('net accounts ^| find "Lockout"') do (
	echo.%%I | find "threshold" >NUL && set T=%%J
	echo.%%I | find "duration" >NUL && set D=%%J
	echo.%%I | find "observation" >NUL && set O=%%J
)

call :trim_leading_spaces T
call :trim_leading_spaces D
call :trim_leading_spaces O

echo Threshold: %T%
echo Duration: %D%
echo Observation: %O%
Output (on my machine):
Code:
Threshold: Never
Duration: 30
Observation: 30
My System SpecsSystem Spec
Reply

 Account lockout policy




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Account Lockout Policy Clarification
Hello Guys, Can somebody interpret this one for me. Account Lockout Duration : 0 minutes Account threshold : 15 Reset Account Lockout after: 10 minutes. Thanks in advance.
General Discussion
Account Lockout - Unlock a Locked Out User Account
How to Unlock a Locked Out User Account in Windows 7 and Windows 8 Normally the account lockout duration security setting determines the number of minutes a locked out account remains locked out before automatically becoming unlocked. If the account lockout duration is set to 0 minutes, then a...
Tutorials
Account Lockout: Defining an Audit Policy
How to Set an Audit Policy for an Account Lockout This is attempt to help tracing in the Event Viewer, the Account Lockout Failure and Success "Log On" in windows 7 and Windows 8, after you set up the "Account Lockout Threshold for Invalid Logon Attempts". In order this Tip to Work, you"ll have...
Tutorials
account lockout policy
Hi, I recently installed win 7 ent. edition and i decided to change the account lockout threshold 4 invalid attempts. Everytime i shutdown the system and rebooted my account would be lockout for no reason. now its only happens to my account. This seems to happen on both my computers on the...
General Discussion
Account lockout problem
Hello all, Windows 7 has made my Account Lockout Duration set to 99360 minutes (69 days). What's really bad is I can't change this. It's disabled even though I'm an admin. I've search for days trying to figure out how I can change this and was hoping someone here could help me. TIA,
System Security
Account Lockout (sort of) in Win 7
Hello All, I'm having a wierd problem since installing Windows 7 Ultimate (RTM). Whenever I lock my computer, I can't log back in - it says that the password is incorrect. However, if I cancel my attempt to log back in, and then click that button "Log in as a different user", and then manually...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 10:06.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App