Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Win PE 2.0 getting an ADORecordSet Error

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Win PE 2.0 getting an ADORecordSet 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 >>
 Win PE 2.0 getting an ADORecordSet Error - 4/30/2008 7:25:58 AM   
  BryanP

 

Posts: 2
Score: 0
Joined: 4/30/2008
Status: offline
I run an AD Query from Vista, XP I get the correct out put when I run the same script from WinPE 2.0 I am getting an error on the Line for Set adorecordset = adocommand.execute

here is the full script which I pulled from another post on the forums.

Dim objRootDSE, strDNSDomain, adoCommand, adoConnection
Dim strBase, strFilter, strAttributes, strQuery, adoRecordset
Dim strDN, strUser, strPassword, objNS, strServer
Const ADS_SECURE_AUTHENTICATION = &H1
Const ADS_SERVER_BIND = &H200

' Specify a server (Domain Controller).
strServer = "ADC"
' Specify or prompt for credentials.
strUser = "Domain\adminname"
strPassword = "BLABLA"
' Determine DNS domain name. Use server binding and alternate
' credentials. The value of strDNSDomain can also be hard coded.
'Set objNS = GetObject("LDAP:")
'Set objRootDSE = objNS.OpenDSObject("LDAP://" & strServer & "/RootDSE", _
   'strUser, strPassword, _
  'ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION)  
'strDNSDomain = objRootDSE.Get("defaultNamingContext")
strDNSDomain = "DC=Domain,DC=Rootdomain,DC=com"
' Use ADO to search Active Directory.
' Use alternate credentials.
Set adoCommand = CreateObject("ADODB.Command")
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.Provider = "ADsDSOObject"
adoConnection.Properties("User ID") = strUser
adoConnection.Properties("Password") = strPassword
adoConnection.Properties("Encrypt Password") = True
adoConnection.Properties("ADSI Flag") = ADS_SERVER_BIND _
   Or ADS_SECURE_AUTHENTICATION
adoConnection.Open "Active Directory Provider"
adoCommand.ActiveConnection = adoConnection
' Search entire domain. Use server binding.
strBase = "<LDAP://" & strServer & "/" & strDNSDomain & ">"
' Search for all users.
strFilter = "(&(objectCategory=Computer)(Name=compname))"
' Comma delimited list of attribute values to retrieve.
strAttributes = "distinguishedName"
' Construct the LDAP query.
strQuery = strBase & ";" & strFilter & ";" _
   & strAttributes & ";subtree"
' Run the query.
adoCommand.CommandText = strQuery
adoCommand.Properties("Page Size") = 100
adoCommand.Properties("Timeout") = 30
adoCommand.Properties("Cache Results") = False
Set adoRecordset = adoCommand.Execute
' Enumerate the resulting recordset.
Do Until adoRecordset.EOF
  ' Retrieve values.
  strDN = adoRecordset.Fields("distinguishedName").Value
  Wscript.Echo strDN
  adoRecordset.MoveNext
Loop
' Clean up.
adoRecordset.Close
adoConnection.Close

Has anyone ran into this issue befor and know a way around it.

 
 
Post #: 1
 
 RE: Win PE 2.0 getting an ADORecordSet Error - 5/1/2008 12:29:17 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
Have you enabled support for ADDOB in PE?  This is not something that is normally enabled by default.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to BryanP)
 
 
Post #: 2
 
 RE: Win PE 2.0 getting an ADORecordSet Error - 5/1/2008 12:59:50 AM   
  BryanP

 

Posts: 2
Score: 0
Joined: 4/30/2008
Status: offline
There were no options to add that support in 2.0, all there was is HTA, MDAC, XML, and Scripting langages support.  If there is on for ADO where would I find that.

(in reply to mbouchard)
 
 
Post #: 3
 
 RE: Win PE 2.0 getting an ADORecordSet Error - 5/1/2008 1:04:13 AM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
There isn't a MS supported way but you can go to the WinPE forum here http://www.msfn.org/board/forums.html and find instructions on how to do it.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to BryanP)
 
 
Post #: 4
 
 RE: Win PE 2.0 getting an ADORecordSet Error - 5/1/2008 1:07:36 AM   
  ebgreen


Posts: 4595
Score: 29
Joined: 7/12/2005
Status: offline
See if this helps:

http://www.msfn.org/board/LDAP-in-Win-PE-20-t89923.html



If it does, then google is your friend.

_____________________________

"... 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 BryanP)
 
 
Post #: 5
 
 
 
  

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 >> Win PE 2.0 getting an ADORecordSet 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