Solved

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

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

821 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