[ADSI & ASP] Bad Pathname !?

Pagina: 1
Acties:

  • ArjanC
  • Registratie: Juli 2001
  • Laatst online: 26-01 17:16
hoi,

ik wil via ADSI informatie uit onze AD server halen.. daarvoor heb ik dit scriptje :

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Dim userObj
Set dso =GetObject("LDAP:")

ad = "LDAP://d1lon100/CN=Coolegem\, Arjan,OU=Users & Groups,OU=EUR,DC=D1,DC=AD,DC=APL,DC=com"


username = "apl\acoolege"
password = "<nietzichtbaar>"
Set userObj = dso.Opendsobject(ad,username,password,0)

Response.Write("<BR>" & ad & "<BR>")

Set userSchema = GetObject(userObj.schema)

Response.Write "The sample values... <BR>"
With userObj
Response.Write "<B>User Display: </B>" & .displayName & "<BR>"
Response.Write "<B>Manager: </B>" & .manager & "<BR>"
Response.Write "<B>Adsi Path: </B>" & .ADsPath & "<BR>"
Response.Write "<B>Department: </B>" & .Department & "<BR>"
Response.Write "<B>Last Login: </B>" & .LastLogin & "<BR>"
Response.Write "<B>countryCode: </B>" & .countryCode & "<BR>"
Response.Write "<B>userPassword: </B>" & .userPassword & "<BR>"
Response.Write "<B>Phone Number: </B>" & .telephoneNumber & "<BR><BR>"

End With



Maar deze komt terug met een 0x80005000L E_ADS_BAD_PATHNAME error melding.

maar met dit script :
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
SQLStmt = "SELECT * FROM 'LDAP://d1rot100/OU=Users & Groups,OU=EUR,dc=d1,dc=ad,dc=apl,dc=com' WHERE objectClass='*'"

Set Conn = CreateObject("ADODB.Connection")
Conn.Provider = "ADSDSOObject"

Conn.Open "ADs Provider","apl\acoolege","<niet zichtbaar>"

Set rs = Conn.Execute(SQLStmt)

Do While Not rs.EOF Or rs.BOF
   ReturnValue = rs.Fields(0)
   If IsArray(ReturnValue) Then
        For I = LBound(ReturnValue) To UBound(ReturnValue)
            If ReturnValue(I) <> "" Then
                Response.Write ReturnValue(I) & "<BR>"
            End If
        Next
   Else
        Response.Write ReturnValue & "<BR>"
   End If
   rs.MoveNext
Loop


heb ik de gehele path directory gekregen. dus die is wel goed 8)7

wat doe ik nou fout?

edit: sorry voor de layout

Verwijderd

Klopt dit stukje in je path-definitie wel? Het lijkt mij dat hier ergens iets fout zit (back-slash, komma's, geen komma voor de 'CN'):

code:
1
/CN=Coolegem\, Arjan,