Displays password policy settings for the domain.
Const MIN_IN_DAY = 1440, SEC_IN_MIN = 60Set objDomain = GetObject("WinNT://fabrikam")Set objAdS = GetObject("LDAP://dc=fabrikam,dc=com")intMaxPwdAgeSeconds = objDomain.Get("MaxPasswordAge")intMinPwdAgeSeconds = objDomain.Get("MinPasswordAge")intLockOutObservationWindowSeconds = objDomain.Get("LockoutObservationInterval")intLockoutDurationSeconds = objDomain.Get("AutoUnlockInterval")intMinPwdLength = objAds.Get("minPwdLength")intPwdHistoryLength = objAds.Get("pwdHistoryLength")intPwdProperties = objAds.Get("pwdProperties")intLockoutThreshold = objAds.Get("lockoutThreshold")intMaxPwdAgeDays = _((intMaxPwdAgeSeconds/SEC_IN_MIN)/MIN_IN_DAY) & " days"intMinPwdAgeDays = _((intMinPwdAgeSeconds/SEC_IN_MIN)/MIN_IN_DAY) & " days"intLockOutObservationWindowMinutes = _(intLockOutObservationWindowSeconds/SEC_IN_MIN) & " minutes"If intLockoutDurationSeconds <> -1 ThenintLockoutDurationMinutes = _(intLockOutDurationSeconds/SEC_IN_MIN) & " minutes"ElseintLockoutDurationMinutes = _"Administrator must manually unlock locked accounts"End IfWScript.Echo "maxPwdAge = " & intMaxPwdAgeDaysWScript.Echo "minPwdAge = " & intMinPwdAgeDaysWScript.Echo "minPwdLength = " & intMinPwdLengthWScript.Echo "pwdHistoryLength = " & intPwdHistoryLengthWScript.Echo "pwdProperties = " & intPwdPropertiesWScript.Echo "lockOutThreshold = " & intLockoutThresholdWScript.Echo "lockOutObservationWindow = " & intLockOutObservationWindowMinutesWScript.Echo "lockOutDuration = " & intLockoutDurationMinutes
This is a VB Script, this can be used by saving the file in .vbs file