RemoveUserFromGroup() public method

Removes the user from the specified group
public RemoveUserFromGroup ( System.DirectoryServices.AccountManagement.UserPrincipal adUser, string groupName ) : void
adUser System.DirectoryServices.AccountManagement.UserPrincipal User to remove
groupName string Group from which the user should be removed
return void
 /// <summary>
 /// Remove the ADUser from a group
 /// </summary>
 /// <param name="groupName">The name of the group from which the ADUser should be removed</param>
 public void removeFromGroup(string groupName)
 {
     try
     {
         _connection.RemoveUserFromGroup(_sourceUser, groupName);
     }
     catch (Exception ex)
     {
         string msg = String.Format("Error removing user '{0}' from group '{1}': '{2}'", this.DisplayName, groupName, ex.Message);
         Console.WriteLine(msg);
         throw new ADException(msg, ex);
     }
 }