Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

use .net visual basic to query ldap

Posted on 2014-03-07
3
Medium Priority
?
1,328 Views
Last Modified: 2014-03-11
How can i get this info from ldap using .net visual basic?

Query hostname: ldapapi.mydomain.com
Base ou: "ou=people,ou=mydomain"
Ldap filter: "unixid=<userid>"
Requested attribute: title
0
Comment
Question by:chadmanvb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 39914526
0
 

Author Comment

by:chadmanvb
ID: 39917423
Those all look similar to how I would query active directory.  In this case I'm not querying active directory, but it is another ldap directory.  Can I do the same thing?  Below is some code in vbs that gets the attribute I need.  I just need to so the same thing in .net

Function getTitleInfo (userid)
 objCommand.CommandText =  "SELECT TITLE FROM 'LDAP://ldapapi/ou=people,o=My Domain' WHERE unixid='" & userid & "'"
 Set objRecordSet = objCommand.Execute
 On Error Resume Next
 While Not objRecordSet.EOF
   For Each i in objRecordSet.fields
      For Each v in i.value
         MsgBox(v) 'here I get the title info I was looking for...how can I do this in .net?
      Next
   Next
   objRecordSet.MoveNext
 Wend
 objConnection.close
End Function
0
 

Author Closing Comment

by:chadmanvb
ID: 39920883
Thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question