Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDAP memberOf query (beginner)

Status
Not open for further replies.

ribsa3

Programmer
Jun 17, 2003
56
Hi,

I hope someone can help shed some light on what has to be a supremely simple LDAP query situation.

I merely wish to list all the users in the "Domain Users" group in AD and present them in a Listbox. I have never worked with LDAP until now, and picking up bits and pieces around the net, I have established a very basic query listing the available groups with this chunk of code:


Dim Entry As DirectoryEntry = New DirectoryEntry("LDAP://mydomain")
Dim Query As DirectorySearcher = New DirectorySearcher(Entry)
Dim Result As SearchResult

Query.Filter = ("(objectCategory=group)")

ListBox1.Items.Add("======== Start ========")

For Each Result In Query.FindAll()
ListBox1.Items.Add(Result.GetDirectoryEntry().Name.ToString())
Next

ListBox1.Items.Add("===== End of Listing =====")


I read much about "memberOf", but haven't quite gotten a bead on it yet - other than my seeming to need an extra array to play with. I would therefore be grateful if someone would shed some light and fill in the extra few lines of code that I need to filter users by group as I first set out to do.


Thank you very much in advance,

-B

--------------------------------------------------------------------
He who asks is a fool for five minutes, but he who does not ask remains a fool forever.
-Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top