Solved

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

Posted on 2006-07-10
8
304 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

11 Experts available now in Live!

Get 1:1 Help Now