473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

VB.NET LDAP query HELP

I have the following code to show all members of a domain
global group that is selected from a drop down list. I
can display the property "member" just fine which shows a
listing like:

CN=Jones\, Bill, CN=Group, OU=domain
However, I need to go a step further and display other
information about a user such as phone number, building,
etc. Is there anyway to find the information I need from
AD with what is returned form the property "Member". Or
is there a better way for me to do this?

Thanks

Dim groupEntry As New DirectoryEntry("LDAP://" &
ddl_ggselect.SelectedValue)
Dim entryMembers As PropertyValueCollection
entryMembers = groupEntry.Properties("Member")

Dim memberValue As Object
For Each memberValue In entryMembers

Response.Write(memberValue & "<br>")
'Right here I need to go a step further and
connect to the memberValue variable to return more
information about the retrieved user.
Next
Nov 22 '05 #1
2 5902
>However, I need to go a step further and display other
information about a user such as phone number, building,
etc. Is there anyway to find the information I need from
AD with what is returned form the property "Member".


Yes - take the string (the user's "DN" - distinguishedName) that
member returns, and then add LDAP:// to its beginning, and bind to
that object - here's a sample in C# - should be easy to translate to
VB.NET:

DirectoryEntry deGroup = new DirectoryEntry("LDAP://" + strGroupName);

foreach(object oUser in deGroup.Properties["member"])
{
string strUserPath = "LDAP://" + oUser.ToString();

DirectoryEntry deUser = new DirectoryEntry(strUserPath);
if(deUser != null)
{
Console.WriteLine("User's full name: " +
deUser.Properties["givenName"].Value + " " +
deUser.Properties["sn"].Value);
}
}

Marc
================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Nov 22 '05 #2
>However, I need to go a step further and display other
information about a user such as phone number, building,
etc. Is there anyway to find the information I need from
AD with what is returned form the property "Member".


Yes - take the string (the user's "DN" - distinguishedName) that
member returns, and then add LDAP:// to its beginning, and bind to
that object - here's a sample in C# - should be easy to translate to
VB.NET:

DirectoryEntry deGroup = new DirectoryEntry("LDAP://" + strGroupName);

foreach(object oUser in deGroup.Properties["member"])
{
string strUserPath = "LDAP://" + oUser.ToString();

DirectoryEntry deUser = new DirectoryEntry(strUserPath);
if(deUser != null)
{
Console.WriteLine("User's full name: " +
deUser.Properties["givenName"].Value + " " +
deUser.Properties["sn"].Value);
}
}

Marc
================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jeremy | last post by:
Hello. I have an asp.net application that resides on a non-DC / BDC Sharepoint Server (although it is logged into the domain). The application will perform lookups based on the current user...
4
by: m96 | last post by:
hi, i'm trying to make a query to a ldap server (version v2 or v3 doen't matter) with c#. the query works just fine but the problem is that i can't read the custom attributes/fields, since .net...
3
by: Jay | last post by:
I have a simple LDAP query (grabs all users from a particular AD group and populates a checkboxlist) that works perfectly fine on the development machine logged on locally as any user. When I...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
3
by: Chad Beckner | last post by:
I am starting to translate some code from ASP to ASP.NET (VB). I was able to query ADS to get a users groups that they belong to, and also query a group and get a list of users. However, I can't...
3
by: maria.s | last post by:
Hi, I've got a problem with an LDAP query submitted from my ASP.NET application. Configuration: Windows 2003 Server Standard Ed., the application uses Windows Integrated Authentication and is...
5
by: Bryan | last post by:
Hello, I have a asp.net app working with directory services on my Windows XP development machine. However when I moved the application over to our production server (Win 2000 Server) it no longer...
0
by: Gerry Sinkiewicz | last post by:
Looking for a bit of software that will accept an LDAP query via port 389 and convert it to an SQL query and return the results to the originating LDAP client. Basically a dialect converter LDAP...
3
by: RJN | last post by:
Hi I've written a code that queries Windows LDAP server and works fine, but the same doesn't work when querying Solaris LDAP server. DirectoryEntry de = new...
7
by: MrHelpMe | last post by:
Sorry everyone, NOTE: I have posted this question to another site but unfortunately, am not getting the answers I need only because those helping haven't worked with ASP. I am in desperate...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.