ADLib.ADUser.addToGroup C# (CSharp) Method

addToGroup() public method

Add the ADUser to a group
public addToGroup ( string groupName ) : void
groupName string The name of the group to which the user should be added
return void
        public void addToGroup(string groupName)
        {
            try
            {
                _connection.AddUserToGroup(_sourceUser, groupName);
            }
            catch (Exception ex)
            {
                string msg = String.Format("Error adding user '{0}' to group '{1}': '{2}'", this.DisplayName, groupName, ex.Message);
                Console.WriteLine(msg);
                throw new ADException(msg, ex);
            }
        }