Solved

use .net visual basic to query ldap

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now