Are LDAP queries in VBScript supported in some decent way? LDAP gives
strange results.

ldapPath = "LDAP://10.31.10.2/ou=Test,o=TEST"
ldapFilter = "(|(objectClass=inetOrgPerson)(objectClass=use r))" 'uid
entryDN
ldapAttr = "cn"
ldapQuery = "<" & ldapPath & ">;" & ldapFilter & ";" & ldapAttr &
";subtree"

Set conn = CreateObject("ADODB.Connection")
conn.Provider = "ADsDSOObject"
conn.Open "Ads Provider", "cn=query,ou=Test,o=TEST", "password"

Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = conn
cmd.CommandText = ldapQuery
Set rs = cmd.Execute

Do Until rs.EOF
For Each field In rs.Fields
WScript.Echo field.Name & ":"
res = field.Value
If IsArray(res) Then
For i = LBound(res) To UBound(res)
If res(i) <> "" Then
WScript.Echo field.Name & " | "& res(i)
End If
Next
Else
If Not IsNull(res) Then
WScript.Echo field.Name & " | "& res
End If
End If
Next
rs.MoveNext
Loop

The rs.Value are just nulls... CN is empty! But when I query for the
attribute givenName it gives the results as expected.
Decent eDir examples/support seem to be extremely rare on the internet.
When I want to get some info from AD (no matter what) I can find it.

Even the filters won't work decent. Like: ldapFilter =
"(&(objectClass=user)(cn=143356))" or ldapFilter = "(uid=143356)". No
results...


--
rinzwind
------------------------------------------------------------------------
rinzwind's Profile: http://forums.novell.com/member.php?userid=64840
View this thread: http://forums.novell.com/showthread.php?t=451634