users' last-logon-timestamp
I am having a windows 2000 at native functional level with mixed windows 2000 and windows 2003 DCs. Recently i enabled additional account info on the ADUC. After doing the same i found users last-logon-timestamp from AD Users and computers.
I wanted to know if there is a way I can get report on users' last-logon-timestamp from Active directory instead of manually clicking each user to get it? If yes, please help me out.
Re: users' last-logon-timestamp
While searching for the same i came through a website having 2 VBScript which will help you to retrieve last logon dates. Just check this:http://www.rlmueller.net/Last%20Logon.htm.
Re: users' last-logon-timestamp
Thanks for the help friend. But i dont think that is going to help me because i'm using windows 2000 native mode with mixed Windows 2000 and windows 2003 DCs.
I found this script:
_____________________
strUserDN = "cn=alice,cn=users,dc=a,dc=b,dc=local"
set objUser = GetObject("LDAP://" & strUserDN)
set objLogon = objUser.Get("lastLogonTimestamp")
intLogonTime = objLogon.HighPart * (2^32) + objLogon.LowPart
intLogonTime = intLogonTime / (60 * 10000000)
intLogonTime = intLogonTime / 1440
WScript.Echo "Approx last logon timestamp: " & intLogonTime + #1/1/1601#
_____________
Problem is when i tried running it gives me an error message saying "Active Directory: The directory property cannot be found in the cache"
What is it? Please help.
Re: users' last-logon-timestamp
Hello HenrikK. I think you should make use of lastLogon if you are not in Windows 2003 native mode. I assume as youi flipped that setting in AD has caused the lastLogonTimestamp to get populated. Anyway, apart from this lastLogonTimestamp is a "normal" date time, so you don't need to do
anything for this.
Re: users' last-logon-timestamp
Thank you very much for the help Javalr. Your suggestion worked for me when i changed the lastlogon. By the way i would also like to know if there is any way to run all members of one group such as domain admins?