#include <lsasecur.au3>
$aAudit = _SePolicyQueryAuditEvent(@ComputerName) ; Audit Policy
__SeArrayDisplay($aAudit, "Audit Policy")
Const $tagUSER_MODALS_0 = "long MinPswdLen;long MaxPswdAge;long MinPswdAge;long ForceLogoff;long PswdHistLen"
Const $tagUSER_MODALS_3 = "long LockoutDuration;long LockoutObservationWindow;long LockoutThreshold"
$pPswdPolicy = _SeGetUserModals(0, @ComputerName) ; Password Policy
$tPswdPolicy = DllStructCreate($tagUSER_MODALS_0, $pPswdPolicy)
; Minimum password length.
DllStructGetData($tPswdPolicy, "MinPswdLen")
; Maximum password age.
DllStructGetData($tPswdPolicy, "MaxPswdAge")
; Minimum password age.
DllStructGetData($tPswdPolicy, "MinPswdAge")
; Length of the password history maintained.
DllStructGetData($tPswdPolicy, "PswdHistLen")
$pLockPolicy = _SeGetUserModals(3, @ComputerName) ; User Lockout Policy
$tLockPolicy = DllStructCreate($tagUSER_MODALS_3, $pLockPolicy)
; How long a locked account remains locked before it is automatically unlocked.
DllStructGetData($tLockPolicy, "LockoutDuration")
; The maximum time, in seconds, that can elapse between any two failed logon attempts before lockout occurs.
DllStructGetData($tLockPolicy, "LockoutObservationWindow")
; The number of invalid password authentications that can occur before an account is marked "locked out."
DllStructGetData($tLockPolicy, "LockoutThreshold")
|