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!
Peter Bradley - 21 Jun 2007 17:04 GMT
.NET uses the System.DirectoryServices namespace. It is quite different to
what you're used to.
There's a very good book on the subject:
http://www.amazon.co.uk/Developer-Directory-Programming-Microsoft-Development/dp
/0321350170/ref=sr_1_1/203-4322956-9231950?ie=UTF8&s=books&qid=1182441696&sr=1-1
Joe Kaplan, the author, posts regularly on the microsoft.public.adsi.general
newsgroup and is as helpful a person as any I have ever come across. He
certainly dug me out of a few trenches I'd got myself into.
HTH
Peter
>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
[quoted text clipped - 21 lines]
>
> Thanks in advance for your assistance!