Solved

Get the MEMBERS of an ACTIVE DIRECTORY GROUP, and LIST the FULL NAMES and USERNAMES

Posted on 2006-07-10
8
305 Views
Last Modified: 2010-04-23
Technologies: Windows Server 2003, Active Directory, Visual Basic .NET 2005, .NET Framework 2.0

I am writing an application that unlocks user accounts and resets their passwords. Performing those actions isn't a problem. However, to make the process more user-friendly, I am adding a drop-down box of users that can be used to find the user to unlock/change password.

The DropDown Box should show a list of the Full Names (John Doe, John Smith etc) of all the users of a Domain Group, but the actual values of the entries should be the logon name in Active Directory (john.doe, john.smith etc).

I want some way to connect to Active Directory, find the group (it is NOT Domain Users), list the members of the group (list both their Full Name and their username/logon name), and populate the Text & Value properties of the DropDown Box items with the entries from Active Directory.

Connecting to active directory is fine, as is databinding the DropDown Box, I basically just need to get a table with two columns, Username and Fullname, of all the members of a specified group.

Thanks in advance!
0
Comment
Question by:techxero
  • 4
8 Comments
 
LVL 11

Expert Comment

by:MacNuttin
ID: 17076268
0
 
LVL 11

Expert Comment

by:MacNuttin
ID: 17076286
0
 

Author Comment

by:techxero
ID: 17085052
Still can't work it out I'm afraid, does anyone have any code snippets?
0
 
LVL 11

Accepted Solution

by:
MacNuttin earned 500 total points
ID: 17085252
This is from MSDN the link I sent you:
Try
' Bind to the users container.
Dim entry As New DirectoryEntry("LDAP://CN=users,DC=fabrikam,DC=com")
' Create a DirectorySearcher object.
Dim mySearcher As New DirectorySearcher(entry)
' Create a SearchResultCollection object to hold a collection of SearchResults
' returned by the FindAll method.
Dim result As SearchResultCollection = mySearcher.FindAll()
' Create an object to hold a single result from the result collection.
Dim resEnt1 As SearchResult
' Get search results. For more information, see Getting Search Results.
'
' This sample uses Try...Catch to catch errors.
' Create an Exception object. For more information, see System.Exception.
Catch Else
    Dim exception As New System.Runtime.InteropServices.COMException()
    Console.WriteLine(exception)
Catch Else
    Dim InvOpEx As New InvalidOperationException()
    Console.WriteLine(InvOpEx.Message)
Catch Else
    Dim NotSuppEx As New NotSupportedException()
    Console.WriteLine(NotSuppEx.Message)

End Try
0
 
LVL 11

Expert Comment

by:MacNuttin
ID: 17220393
did you get your app to work?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

910 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

20 Experts available now in Live!

Get 1:1 Help Now