Solved

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

Posted on 2006-07-10
8
306 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help parsing JSON in my VB.Net application 4 97
Exit the loop 4 43
Close form "before" open 3 41
How to duplicate form in Visual Studio 2015 2 18
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 …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

832 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