ADLib.ADUser.removeFromGroup C# (CSharp) Method

removeFromGroup() public method

Remove the ADUser from a group
public removeFromGroup ( string groupName ) : void
groupName string The name of the group from which the ADUser should be removed
return void
        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);
            }
        }