J'ai ce code simple:Ajout d'un groupe de domaine groupe local
String containerPath = String.Format("WinNT://{0}/{1},group", Environment.MachineName, localGroupName);
using (System.DirectoryServices.DirectoryEntry theContainerGroup= new System.DirectoryServices.DirectoryEntry(containerPath))
{
String path = String.Format("WinNT://{0}/{1},group", theGroupToAdd_Domain, theGroupToAdd_Name);
theContainerGroup.Invoke("Add", new object[] { path});
theContainerGroup.CommitChanges();
}
et il semble fonctionner très bien pour les groupes globaux et universels. Cependant quand j'essaye d'ajouter un groupe qui a le type DomainLocal | Builtin, il me donne une exception "ne peut pas trouver l'objet".
Ce scénario n'est-il pas pris en charge? Ou dois-je modifier mon chemin pour ce type de groupe?