; read flags
$Flags = $objUser.UserFlags
; if not disabled, and not Never Expires, report on expired or about to expire accounts
If Not $objUser.AccountDisabled And Not ($Flags & 65536)
$ExpDate = FixDate($objUser.PasswordExpirationDate)
$Days = Int(TimeDiff('Now', $ExpDate, 'D'))
$LStat = $objUser.IsAccountLocked
$EStat = $objUser.PasswordExpired
If $EStat Or $LStat Or $Days < 10
$R = $R + 1
ReDim Preserve $RptData[$R]
$RptData[$R] = Left($Member + ' ', 15)
$RptData[$R] = $RptData[$R] + Left($objUser.FullName + ' ', 40)
; display LOCKED and EXPIRED status
If $LStat
$RptData[$R] = $RptData[$R] + 'LOCKED '
Else
$RptData[$R] = $RptData[$R] + ' '
EndIf
If $EStat
$RptData[$R] = $RptData[$R] + 'EXPIRED ' + @CRLF + ' ' + $ExpDate
Else
; get remaining days
If $Days < $MaxDays
$RptData[$R] = $RptData[$R] + $Days + ' REMAIN ' + @CRLF + ' ' + $ExpDate
Else
$RptData[$R] = $RptData[$R] + ' '
EndIf
EndIf
If Exist('.\debug.txt')
$RptData[$R] ?
$I = $I + 1
If $I > 100 Quit 0 EndIf
EndIf
EndIf
EndIf