I once had to list users in our NT Domain that have never logged in examining the LastLogin property of the user Object.
It somehow depends though on when this property gets modified, so you need to test this (works on NT boxes only with ADSI runtimes installed)
Create a new user and assign this as the logon script, to doublecheck, let it run for a user that has already logged in:
Code:
break on
dim $objUsr
$objUsr = getobject("WinNT://" + @domain + "/" + @userid + ",user")
if not @error
if not vartype($objUsr.LastLogin)
"User " + @userid + " has never logged in before" ?
else
"Last login of " + @userid + " was at " + $objUsr.LastLogin ?
endif
else
"Error retrieving User object..." ?
endif
"Hit any key to quit ..."
get $
exit 0
Edited by Jochen (2005-05-09 12:46 PM)
_________________________