Hello,
I am quering the LDAP directory of IBM Tivoli, and am using the following VBSCRIPT. The script below works fine. However, when I add one of our custom attributes to the query ...
Replacing: "(&(objectclass=*)(uid=cor
dnerd));cn
,uid;subtr
ee"
With: "(&(objectclass=*)(uid=cor
dnerd));cn
,uid,tutui
d;subtree"
I get the following error.
--------------------------
-
Windows Script Host
--------------------------
-
Script: I:\VBS\GetLDAPData.VBS
Line: 26
Char: 5
Error: Unspecified error
Code: 80004005
Source: Provider
--------------------------
-
OK
--------------------------
-
Here's the whole script that works.
Dim conn
Dim com
Dim oRecordset
Dim sTmp
Dim ReturnValue
'*************************
******
' Open the connection to LDAP
'*************************
******
Set conn = CreateObject("ADODB.Connec
tion")
conn.Provider = "ADsDSOObject"
conn.Properties("User ID") = "cn=TheMan"
conn.Properties("Password"
) = "thepassword"
Dim strCN
'conn.Open "LDAP Provider"
conn.Open "ADs Provider"
Set com = CreateObject("ADODB.Comman
d")
Set com.ActiveConnection = conn
com.CommandText = "<LDAP://idprod4.ocis.temp
le.edu:138
9/ou=0,ou=
people," & _
"erglobalid=00000000000000
000000,ou=
Temple,dc=
edu>;" & _
"(&(objectclass=*)(uid=cor
dnerd));cn
,uid;subtr
ee"
com.Properties("Page Size") = 100000
com.Properties("Timeout") = 60
Set oRecordset = com.Execute
wscript.echo oRecordset.recordcount
Do While Not oRecordSet.EOF
sTmp=""
For i = 0 To oRecordSet.Fields.Count-1
ReturnValue = oRecordSet.Fields(i)
If IsArray(ReturnValue) Then
For j = LBound(ReturnValue) To UBound(ReturnValue)
If ReturnValue(j) <> "" Then
sTmp=sTmp & "," & ReturnValue(j)
End If
Next
Else
End If
Next
wscript.echo sTmp
oRecordSet.MoveNext
Loop
Any help would be GREATLY appreciated.
--
Don
Start Free Trial