Solved

use .net visual basic to query ldap

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

827 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