Skip to content

User Group

add_user_to_usergroup

add_user_to_usergroup <USERNAMES> <USERGROUPS>

Add users to usergroups.

Ignores users not in user groups. Users and groups must exist.

Arguments

USERNAMES
Usernames to add. Comma-separated.
Type: text
Required:

USERGROUPS
User groups to add the users to. Comma-separated.
Type: text
Required:


add_usergroup_permissions

add_usergroup_permissions <USERGROUP> [OPTIONS]

Give a user group permissions to host/template groups.

Run show_hostgroups to get a list of host groups, and show_templategroups --no-templates to get a list of template groups.

Arguments

USERGROUP
User group to give permissions to.
Type: text
Required:

Options

--hostgroup <HOSTGROUPS>
Comma-separated list of host group names.
Type: text

--templategroup <TEMPLATEGROUPS>
Comma-separated list of template group names.
Type: text

--permission <PERMISSION>
Permission to give to the user group.
Type: choice
Choices: deny, ro, rw, 0, 2, 3


create_usergroup

create_usergroup <USERGROUP> [OPTIONS]

Create a user group.

Arguments

USERGROUP
Name of the user group to create.
Type: text
Required:

Options

--gui <GUI_ACCESS>
GUI access for the group.
Type: choice
Choices: default, internal, ldap, disable, 0, 1, 2, 3
Default: default

--disabled
Create the user group in a disabled state.
Type: boolean
Default: False


remove_user_from_usergroup

remove_user_from_usergroup <USERNAMES> <USERGROUPS>

Remove users from usergroups.

Ignores users not in user groups. Users and groups must exist.

Arguments

USERNAMES
Usernames to remove. Comma-separated.
Type: text
Required:

USERGROUPS
User groups to remove the users from. Comma-separated.
Type: text
Required:


show_usergroup

show_usergroup <USERGROUP> [OPTIONS]

Show one or more user groups by name or ID.

Examples

Show user group 'Admins'

show_usergroup Admins

Show user groups 'Admins' and 'Operators'

show_usergroup Admins,Operators

Show all user groups containing 'web' sorted by ID

show_usergroup '*web*' --sort id

Arguments

USERGROUP
Name or ID of the user group(s) to show. Comma-separated. Supports wildcards.
Type: text
Required:

Options

--sort <SORT>
Sort by field.
Type: choice
Choices: name, id, users
Default: name


show_usergroup_permissions

show_usergroup_permissions <USERGROUP> [OPTIONS]

Show permissions for one or more user groups.

Examples

Show permissions for user group 'Admins'

show_usergroup_permissions Admins

Show permissions for user groups 'Admins' and 'Operators'

show_usergroup_permissions Admins,Operators

Show permissions for all user groups sorted by ID

show_usergroup_permissions * --sort id

Arguments

USERGROUP
Name of user group. Comma-separated. Supports wildcards.
Type: text
Required:

Options

--sort <SORT>
Sort by field.
Type: choice
Choices: name, id, users
Default: name


show_usergroups

show_usergroups <USERGROUP> [OPTIONS]

Show all suser groups.

Can be filtered by name or ID.

Examples

Show all user groups

show_usergroups

Show user groups 'Admins' and 'Operators'

show_usergroup Admins,Operators

Show all user groups containing 'web' sorted by ID

show_usergroup '*web*' --sort id

Arguments

USERGROUP
Name or ID of the user group(s) to show. Comma-separated. Supports wildcards.
Type: text

Options

--sort <SORT>
Sort by field.
Type: choice
Choices: name, id, users
Default: name

--limit, -n <LIMIT>
Limit the number of results. 0 to show all.
Type: integer
Default: 0