Just testing more of the same and this evolved... code:
break on
;
; SCANUSER.K2K
;
; This script enumerates all the user account's in your domain and displays
; their status (expired, disabled and locked-out)...
;
; To get a hardcopy, pipe the output to a file like this...
;
; kix32c scanuser.k2k $out=filename.ext
;
$padding = " "
if $out
if exist("$out")
del "$out"
endif
$= redirectoutput("$out")
endif
$domain = getobject("WinNT://@LDOMAIN")
if $domain
$filter = "user",""
$domain.filter = $filter
for each $user in $domain
$status = ""
if $user.accountdisabled
$status = $status + "disabled"
endif
if $user.passwordexpired
if $status
$status=$status+","
endif
$status = "$status"+"expired"
endif
if $user.accountlocked
if $status
$status=$status+","
endif
$status = $status + "locked"
endif
if $status
$username = substr($user.name+$padding,1,32)
? "$username $status"
endif
next
endif
exit
Shawn
*** Important Info
This script runs only on Windows 2000 workstations and servers... but it will enumerate user's in regular old NT4 domains...
Shawn..
[This message has been edited by Shawn (edited 11 April 2001).]