Thanks Kent,Close... real close...
I'm not familiar with the "As IADsUser" parameter on the DIM statement, and neither is KiX.
Missing a "+" on "@USERID+",. Should read "+@USERID+". So, borrowing from your code:
code:
break on
Dim $usr
$usr = GetObject("WinNT://bdc/administrator,user")
$lastlogof = $usr.LastLogoff
$lastlogin = $usr.LastLogin? "Last logoff according to bdc = "+$lastlogof
? "Last logon according to bdc = "+$lastlogin
$usr = GetObject("WinNT://pdc/administrator,user")
$lastlogof = $usr.LastLogoff
$lastlogin = $usr.LastLogin
? "Last logoff according to pdc = "+$lastlogof
? "Last logon according to pdc = "+$lastlogin
get $_
The output:
quote:
Last logoff according to bdc = 12/12/2001 7:42:52 AM
Last logon according to bdc = 12/14/2001 3:56:20 PM
Last logoff according to pdc = 12/16/2001 4:36:08 AM
Last logon according to pdc = 12/16/2001 4:36:06 AM
Hmm, 4:36 AM??? Must of set administrator for a service account! OOPS!
As you can see from the example above, the values are not replicated and must be read from all DCs.