zcolton,
could you help me, how to view department field using LDAP?
everytime I tried to get department data, I got "Unspecified Error".
here is my script.
<%
sub getXdata(xlogin)
Set cnvt = CreateObject("ADs.ArrayConvert")
set con=createobject("ADODB.Connection")
set rsLDAP = Server.CreateObject("ADODB.RecordSet")
con.provider="ADSDSOObject"
con.open
strSQL="<LDAP://dc=corp,dc=xxxxxxxxx,dc=com>;" &_
"(&(objectClass=user)(sAMAccountName="&xlogin &"));" &_
"mobile,mail,name,title,physicalDeliveryOfficeName,l,co,department;subtree"
rsldap.open strSQL,con,0,1,&H0001
while not rsldap.eof
For intLoop = 0 To rsldap.Fields.Count - 1
if rsLDAP(intLoop).type=12 and not isnull(rsLDAP(intLoop).value) then
cnvtvalue=cnvt.CStrArray(rsldap(intLoop).value)
for each itemvalue in cnvtvalue
select case intLoop
case 0 xHP=itemvalue
case 1 xmail=itemvalue
case 2 xname=itemvalue
case 3 xpos=itemvalue
case 4 xloc=itemvalue
case 5 xdept=itemvalue
end select
next
else
select case intLoop
case 0 xHP=rsldap(intLoop).value
case 1 xmail=rsldap(intLoop).value
case 2 xname=rsldap(intLoop).value
case 3 xpos=rsldap(intLoop).value
case 4 xloc=rsldap(intLoop).value
case 5 xdept=rsldap(intLoop).value
end select
end if
next
rsldap.movenext
wend
rsldap.close
con.close
end sub
%>