Re: lastLogonTimestamp
- From: Trevor Sullivan <pcgeek86@xxxxxxxxx>
- Date: Tue, 16 May 2006 13:15:19 -0500
Joe Richards [MVP] wrote:
lastLogonTimeStamp is only available in Domain Functional Mode 2
(Windows Server 2003 Mode), most likely you are in Windows 2000 Mode.
--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net
---O'Reilly Active Directory Third Edition now available---
http://www.joeware.net/win/ad3e.htm
Chris wrote:
I've been trying to find out the last time users had logged onto our
domain. I discovered a script here at the TechNet Script Center. I
adapted to what I wanted to query but I ran into an error: "The
directory property cannot be found in the cache." This occured at the
statement executing: Set objLastLogon = objUser.Get("lastLogonTimestamp")
I'm afraid I know very little about AD or LDAP so I can't imagine what
would be the problem. The server is running Windows Server 2003. The
code I used is as follows:
Set objUser = GetObject("LDAP://CN=Ed
Fred,CN=Users,DC=CDPSCITRIX,DC=SAFETY,DC=STATE,DC=CO,DC=US")
Set objLastLogon = objUser.Get("lastLogonTimestamp")
intLastLogonTime = objLastLogon.HighPart * (2^32) + objLastLogon.LowPart
intLastLogonTime = intLastLogonTime / (60 * 10000000)
intLastLogonTime = intLastLogonTime / 1440
Wscript.Echo "Last logon time: " & intLastLogonTime + #1/1/1601#
Could someone assist me on this?
Thanks!
Or perhaps you have a typo in your actual script you're running. Make
sure the attribute you're trying to pull is spelled properly. I was also
going to say something along the lines of what Joe did, however perhaps
something is messed up in your schema. While that's rather unlikely, it
is always possible that someone decided to delete that attribute out of
the schema :)
Trevor Sullivan
Microsoft Certified Professional
.
- Follow-Ups:
- Re: lastLogonTimestamp
- From: Joe Richards [MVP]
- Re: lastLogonTimestamp
- References:
- Re: lastLogonTimestamp
- From: Joe Richards [MVP]
- Re: lastLogonTimestamp
- Prev by Date: Re: lastLogonTimestamp
- Next by Date: Re: Replication problem
- Previous by thread: Re: lastLogonTimestamp
- Next by thread: Re: lastLogonTimestamp
- Index(es):
Relevant Pages
|