LDAP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an ASP web page which is using VB script to create an ADO connection
to LDAP and I was wanting to convert to an ASP.Net web page. I was not quite
sure how to convert the information below into .Net

Set oConnLD = Server.CreateObject("ADODB.Connection")
oConnLD.Provider = "ADsDSOObject"
oConnLD.Open "ADs Provider",
"uid=XXXXXXX,ou=Machines,o=FFFFF,o=FFFFFF.com", "YYYYYYYY"
sSQL = "SELECT firstname,lastname, workphone, mail, adid FROM
'LDAP://PPPPPPP.dev.intranet:1389/o=FFFFFF.com/o=FFFFFF/ou=IDM' WHERE
objectClass='*' and adid= '" & sEmpID & "'"
set oRS = oConnLD.Execute(sSQL)

if not (oRS.EOF and oRS.BOF) then
sName = varOf(oRS("firstname").value)+ " " + varOf(oRS("lastname").value)
sEMail = varOf(oRS("mail").value)
sPhone = varOf(oRS("workphone").value)
end if

I tried using DirectorySearcher class, but this does not return all of the
needed fields, for some reason.

Thanks in advance for your assistance!
 
Back
Top