DirectoryEntry groupEntry = new DirectoryEntry("LDAP://CN=Sales,CN=Users,DC=contoso,DC=com"); List<string> list = new List<string>(); foreach(string dn in groupEntry.Properties["members"]) { try { if(DirectoryEntry.Exists("LDAP://"+dn)) { list.Add(dn); } } catch(Exception e) { list.Add(e.Message); } } return list; The list returned should be CN=Sales Americas,CN=Users,DC=contoso,DC=com CN=Sales EMEA,CN=Users,DC=contoso,DC=com CN=Sales D/A/CH,CN=Users,DC=contoso,DC=com CN=Sales SEA,CN=Users,DC=contoso,DC=com but it is CN=Sales Americas,CN=Users,DC=contoso,DC=com CN=Sales EMEA,CN=Users,DC=contoso,DC=com [...]
read more