Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

LDAP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JimHeavey - 21 Jun 2007 14:19 GMT
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!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.