Hi to you all,

I've encountered a problem with my project,
I'm trying to retrive all members of each group in the A.D (include security groups) of a domain.

the proccess goes like this. I'm enquiring the ldap using directory searcher, for retriving of all groups using the full subtree. After reciving results I'm walking thru each result and retrive its members.

The problem arise when the proccess comes to a group such as "Domain Users" which is a "primary group". on such a group the "member"/"member of" property dosen't seem to work.

I know that there must be a way of retriving the members o such groups so I chalenge you.

I will be more than happy to get ideas

here is part of the code:

searchRoot = new DirectoryEntry(sLDAPRoot, sLDAPUser, sLDAPPassword);
searchRoot.AuthenticationType= AuthenticationTypes.Secure;
DirectorySearcher ds = new DirectorySearcher(searchRoot,"(objectCategory=group)");

ds.PropertiesToLoad.Add("groupType");
ds.PropertiesToLoad.Add("name");
ds.PropertiesToLoad.Add("description");
ds.PropertiesToLoad.Add("objectGUID");
ds.PropertiesToLoad.Add("member");
ds.PropertiesToLoad.Add("distinguishedName");
ds.SearchScope = SearchScope.Subtree;
ds.ServerTimeLimit = new TimeSpan(0,0,0,120,0);
SearchResultCollection src = ds.FindAll();
foreach (SearchResult sr in src)
foreach (string member in sr.Properties["member"])
...

psychovitz