|
|
|||||||
Hi all, Is there a way to find out the last time a user logged off using kix script? thanks in advance. |
||||||||
|
|
|||||||
willo, I rely on my trusty Hyena to give me this info. Hyena however, will not do it programmatically from KiX. I believe ADSI would be able to give you that. Unfortunately, I know less about ADSI than men know about women. I gleaned this tidbit from the Microsoft Active Directory SDK: quote: It is also referenced in the IADsUser properties and methods section as "LastLogoff". Where's our resident ADSI guru when we need him? |
||||||||
|
|
|||||||
Willo/Les, Here you go (untested). Ref - IADsUser Property Methods Last log off code: Last log in code:
- Kent |
||||||||
|
|
|||||||
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: The output: quote: 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. |
||||||||
|
|
|||||||
Les, Like I said.. I just threw that together.. I knew it needed some debugging.. Oh well. - Kent |
||||||||
|
|
|||||||
Kent, No prob... I only mentioned it for those cut and paste junkies looking for a quick fix. Many may not take the time to figure it out on their own. Willo, |
||||||||
|
|
|||||||
Les, Thanks for the help on this.. I have posted a new function and have credited you for the assist. Thanks again, - Kent |