Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Active Directory last login

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,66238
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Active Directory last login
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Active Directory last login - 11/11/2008 6:34:39 PM   
  blackoutnl

 

Posts: 6
Score: 0
Joined: 11/11/2008
Status: offline
Hi guys,

I'm new to the forum and to vbs, however, I have a problem I can't seem to solve.
I want to get the last logondate of any useraccount in active directory (win2003).

I use the following script:
Set objUser = GetObject("LDAP://cn=abcuser ou=accounts, ou=weird, dc=testdomain, dc=local")
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#

At first it worked perfectly, however, since it ran like 5 times, it now only throws 0x80005000 errors at me (line 1 char 1)

Any suggestions are more than welcome!
Regards
 
 
Post #: 1
 
 RE: Active Directory last login - 11/12/2008 2:47:08 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
If that is your complete script, then I think your problem is probably related to an AD issue in your environment.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to blackoutnl)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Active Directory last login Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts