Local Password Policy
Hello,
I am looking to use a vbscript that will list a systems local password policy.
I have the following which lists the Domain password policy, but would like to adapt it for a local systm password policy listing.
set objRoot = getobject("LDAP://RootDSE")
set objDomain = getobject("LDAP://" & objRoot.get("defaultNamingContext"))
maximumPasswordAge = int(Int8ToSec(objDomain.get("maxPwdAge")) / 86400) 'convert to days
minimumPasswordAge = Int8ToSec(objDomain.get("minPwdAge")) / 86400 'convert to days
minimumPasswordLength = objDomain.get("minPwdLength")
accountLockoutDuration = Int8ToSec(objDomain.get("lockoutDuration")) / 60 'convert to minutes
lockoutThreshold = objDomain.get("lockoutThreshold")
lockoutObservationWindow = Int8ToSec(objDomain.get("lockoutObservationWindow")) / 60 'convert to minutes
passwordHistory = objDomain.get("pwdHistoryLength")
Wscript.Echo "Domain Account Policy"
wscript.echo vbtab & "MinimumPasswordAge: " & minimumPasswordAge & " days" & vbcrlf & _
vbtab & "MaximumPasswordAge: " & maximumPasswordAge & " days" & vbcrlf & _
vbtab & "MinimumPasswordLength: " & minimumPasswordLength & " characters" & vbcrlf & _
vbtab & "EnforcePasswordHistory: " & passwordHistory & " passwords remembered" & vbcrlf & _
vbtab & "AccountLockoutDuration: " & accountLockoutDuration & " minutes" & vbcrlf & _
vbtab & "AccountLockoutThreshold: " & lockoutThreshold & " invalid logon attempts" & vbcrlf & _
vbtab & "Reset account lockout counter after: " & lockoutObservationWindow & " minutes"
Can the above be adapted for a specific local server or can you provide a method of obtaining this information using vbscript or another language?
I have tried a convoluted method of using pstools and secedit with a vbscript, but there are some problems with the psexec service hanging so I would prefer a pure scripting approach.
Thank you for any assistance you could provide.
November 22nd, 2010 10:23am
Hi, as this forum focuses on Windows SteadyState specific issues, this inquiry would best be posted to Microsoft VB forum:
http://social.msdn.microsoft.com/Forums/en-US/category/visualbasic
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and
other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
Regards,
Leo HuangPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
November 22nd, 2010 8:19pm