请问各位大侠,
C#能否对于AD中的计算机的安全里添加组或成员?
能的话给个方法吧?谢谢!

解决方案 »

  1.   

    DirectoryEntry dom = new DirectoryEntry();// Find the container (in this case, the Consulting organizational unit) that you 
    // wish to add the new group to.
    DirectoryEntry ou = dom.Children.Find("OU=Consulting");// Add the new group Practice Managers.
    DirectoryEntry group = ou.Children.Add("CN=Practice Managers", "group");// Set the samAccountName for the new group.
    group.Properties["samAccountName"].Value = "pracmans";// Commit the new group to the directory.
    group.CommitChanges();
      

  2.   

    DirectoryEntry group = dom.Children.Find(groupDN);// Add the user to the group.
    group.Properties["member"].Add(userDN);// Commit the changes to the group.
    group.CommitChanges();
      

  3.   

    NET GROUP
    [groupname [/COMMENT:"text"]] [/DOMAIN]
              groupname {/ADD [/COMMENT:"text"] | /DELETE}  [/DOMAIN]
              groupname username [...] {/ADD | /DELETE} [/DOMAIN]
      

  4.   

    那个是windows的命令 
    process.start