Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


objCommand Error

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> objCommand Error
  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 >>
 objCommand Error - 6/25/2008 1:01:14 AM   
  Asurya

 

Posts: 4
Score: 0
Joined: 9/10/2007
Status: offline
Hi All

Still fairly new to VBScripting, but damm I love it, especially when I get an error and then get to find out why, but I'm afraid this one has got me. Searching and reading all over the net hasn't help and neither has trial and error. I reckon you clever people will get the answer in about 20 seconds (and recommend a better way to write this script) but I'll be happy to receive any help you would like to offer.

So, here is it, a script to search AD for the last time every user in 3 separate OU's logged on and dump it into Excel, once I get this part working at least I'm modify it to search all the other DC's and then compare times.

Anyways, getting an error on line 119, which is the line I have highlighted below, specifically: "Microsoft VBScript runtime error: Object required: 'objRecordSet.Fields(...).Value'" It's also worrth adding that it works perfectly fine for the 1st SubRoutine (AdminUsers), gets all the info it should and populates Excel.


      

I'm sure it's probbaly something really easy for anyone who has some expeirence, but at the moment I just can't seem to find what I'm doing wrong.
 
 
Post #: 1
 
 RE: objCommand Error - 6/25/2008 8:19:32 PM   
  Asurya

 

Posts: 4
Score: 0
Joined: 9/10/2007
Status: offline
No-one got a clue?

(in reply to Asurya)
 
 
Post #: 2
 
 RE: objCommand Error - 6/26/2008 12:15:08 AM   
  dm_4ever


Posts: 2639
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Maybe that value is null for some account

If Not IsNull(objRecordSet.Fields("lastLogon").Value) Then
   Set objlastLogon = objRecordSet.Fields("lastLogon").Value
  
   intLastLogonTime = objLastLogon.HighPart * (2^32) + objLastLogon.LowPart
   intLastLogonTime = intLastLogonTime / (60 * 10000000)
   intLastLogonTime = intLastLogonTime / 1440
End IF

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Asurya)
 
 
Post #: 3
 
 
 
  

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 >> objCommand Error 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