Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you tried an LDAP query? The bottom of the page has an example in C# for enumerating through a group to get members. <a href="http://msdn.microsoft.com/en-us/library/aa772126%28v=vs.85%29.aspx" rel="nofollow">MSDN BOL</a></p> <pre><code>using System; using System.DirectoryServices; namespace ADAM_Examples { class EnumMembers { /// &lt;summary&gt; /// Enumerate AD LDS groups and group members. /// &lt;/summary&gt; [STAThread] static void Main() { DirectoryEntry objADAM; // Binding object. DirectoryEntry objGroupEntry; // Group Results. DirectorySearcher objSearchADAM; // Search object. SearchResultCollection objSearchResults; // Results collection. string strPath; // Binding path. // Construct the binding string. strPath = "LDAP://localhost:389/OU=TestOU,O=Fabrikam,C=US"; Console.WriteLine("Bind to: {0}", strPath); Console.WriteLine("Enum: Groups and members."); // Get the AD LDS object. try { objADAM = new DirectoryEntry(strPath); objADAM.RefreshCache(); } catch (Exception e) { Console.WriteLine("Error: Bind failed."); Console.WriteLine(" {0}", e.Message); return; } // Get search object, specify filter and scope, // perform search. try { objSearchADAM = new DirectorySearcher(objADAM); objSearchADAM.Filter = "(&amp;(objectClass=group))"; objSearchADAM.SearchScope = SearchScope.Subtree; objSearchResults = objSearchADAM.FindAll(); } catch (Exception e) { Console.WriteLine("Error: Search failed."); Console.WriteLine(" {0}", e.Message); return; } // Enumerate groups and members. try { if (objSearchResults.Count != 0) { foreach(SearchResult objResult in objSearchResults) { objGroupEntry = objResult.GetDirectoryEntry(); Console.WriteLine("Group {0}", objGroupEntry.Name); foreach(object objMember in objGroupEntry.Properties["member"]) { Console.WriteLine(" Member: {0}", objMember.ToString()); } } } else { Console.WriteLine("Results: No groups found."); } } catch (Exception e) { Console.WriteLine("Error: Enumerate failed."); Console.WriteLine(" {0}", e.Message); return; } Console.WriteLine("Success: Enumeration complete."); return; } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload