Solved

use .net visual basic to query ldap

Posted on 2014-03-07
3
1,282 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 500 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

AWS Certified Solutions Architect - Associate

This course has been developed to provide you with the requisite knowledge to not only pass the AWS CSA certification exam but also gain the hands-on experience required to become a qualified AWS Solutions architect working in a real-world environment.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

622 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