Trouver tous les attributs LDAP
Bonjour,
Ce code retourne tous les attributs dont les valeurs sont déclarées.
Mais comment faire pour retourner la liste des attributs même si leur valeur n'est pas déclarée ?
Merci d'avance
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
DirectoryEntry root = new DirectoryEntry("LDAP://0.0.0.0", "adm", "pwd", AuthenticationTypes.Secure);
DirectorySearcher searcher = new DirectorySearcher(root);
searcher.Filter = "(anr=toto)";
foreach (SearchResult sr in searcher)
{
Console.WriteLine("Search properties for {0}", sr.Path);
foreach (string propertyKey in sr.Properties.PropertyNames)
{
ResultPropertyValueCollection valueCollection = sr.Properties[propertyKey];
foreach (Object propertyValue in valueCollection)
{
Console.WriteLine("{0}:{1}", propertyKey, propertyValue.ToString());
}
} |