1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
/// <summary>
public string EnvoisCheminLdapGroupe(string Groupe)
{
string Chemin = string.Empty;
try
{
DirectorySearcher Chercheur = new DirectorySearcher(Ldap);
Chercheur.Filter = "(&(objectClass=group)(cn=" + Groupe + "))";
if (GroupeExiste(Groupe))
{
SearchResult Resultat = Chercheur.FindOne();
DirectoryEntry DirEntry = Resultat.GetDirectoryEntry();
Chemin = DirEntry.Properties["distinguishedName"].Value.ToString();
return Chemin;
}
else
{
return Chemin;
}
}
catch (System.DirectoryServices.DirectoryServicesCOMException Erreur)
{
Journalisation("Erreur ActiveDIrectory - Fonction EnvoisCheminLdapGroupe", Erreur.ToString(), 0);
throw Erreur;
}
} |