title: Adding a user to a group and a group to an Active Directory user
body: <p>I'm using the code below and it works perfectly. I note that in this code a user is added to a group determiner. I want to know if there is any code that does the reverse, that is, add a group to a specific user.</p>
  
  <pre><code>public void AddToGroup(string userDn, string groupDn) {
  
  try
  {
      DirectoryEntry dirEntry = new DirectoryEntry("LDAP://" + groupDn);
      dirEntry.Properties["member"].Add(userDn);
      dirEntry.CommitChanges();
      dirEntry.Close();
  }
  catch (System.DirectoryServices.DirectoryServicesCOMException E)
  {
      //doSomething with E.Message.ToString();
  }
  </code></pre>
  
  <p>}</p>