I am trying to get rid of the 'stale accounts' in our Active Directory. I
read about the LastLogonTimeStamp from The Scripter Guy or Scripting Center
I ran the script that came from this article. It returned an error that
seems to indicate that the attribute is not set or null. The error
description is "The directory property cannot be found in the cache."
Our AD was first created in Windows 2000, and then promoted to Win2k3. How
can I see the raw data about this attribute?
If it is not set how can I start capturing this data through this attribute?
The script is as follows:
Set objUser = GetObject("LDAP://CN=User Name,OU= Team 1,OU=Team
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#