G
Guest
I have some code that works great, however it returns all
Groups within AD, but I only need it to return Groups that
are in a Specific OU.
I tried setting a filter on the search to that OU's DN, but then
it only returned that DN.
What's the best way using what I currently have?
Here's the basic code...
DirectoryEntry entry = new DirectoryEntry("LDAP://ww.xx.yy.zz","Username",
"Password", AuthenticationTypes.Secure);
DirectorySearcher dSearch = new DirectorySearcher(entry);
dSearch.Filter = "(&(objectClass=group))";
foreach(SearchResult sResultSet in dSearch.FindAll())
{
WHAT TO DO
}
That's the gist of it.
Any pointers would be appreciated.
Groups within AD, but I only need it to return Groups that
are in a Specific OU.
I tried setting a filter on the search to that OU's DN, but then
it only returned that DN.
What's the best way using what I currently have?
Here's the basic code...
DirectoryEntry entry = new DirectoryEntry("LDAP://ww.xx.yy.zz","Username",
"Password", AuthenticationTypes.Secure);
DirectorySearcher dSearch = new DirectorySearcher(entry);
dSearch.Filter = "(&(objectClass=group))";
foreach(SearchResult sResultSet in dSearch.FindAll())
{
WHAT TO DO
}
That's the gist of it.
Any pointers would be appreciated.