Skip to content

Windows Server Windows Server: Groups

Summary

This module contains actions for managing groups on a Windows Server.

Actions

windows_server.groups.

add_domain_group

Add a domain group to a local group on a Windows Server.

This action will succeed if the domain group is already a member of the local group.

Minimum Plugin Version: 7.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • domain_group_name: the name of the group in domain\groupname format

  • local_group_name: the name of the local group

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
7
- windows_server.group.add_domain_group:
    local_group_name: local.group
    # The syntax below escapes the backslash for you
    domain_group_name: >
      domain\example.group
  load:
    windows_server: windows_server

windows_server.groups.

add_user

Add a local or domain user to a group on a Windows Server.

Minimum Plugin Version: 10.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • user_name: a local username or a domain username in domain\username or username@fqdn format

  • group_name: the name of the group to add them to

Output

Nothing is outputted by this action.

Adding a Local User
1
2
3
4
5
- windows_server.groups.add_user:
    user_name: example.user
    group_name: example.group
  load:
    windows_server: windows_server
Adding a Domain User
1
2
3
4
5
6
7
- windows_server.groups.add_user:
    group_name: example.group
    # The syntax below escapes the backslash for you
    user_name: >
      domain\example.user
  load:
    windows_server: windows_server

windows_server.groups.

create

Create a group on a Windows Server.

This action will succeed if a group with the supplied name already exists.

Minimum Plugin Version: 10.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • name: the group name

  • description: an optional description for the group

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- windows_server.groups.create:
    name: example.group
    description: Created by PPA
  load:
    windows_server: windows_server

windows_server.groups.

delete

Delete a group on a Windows Server.

This action will succeed if a group with the supplied name does not exist.

Minimum Plugin Version: 10.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
Output

Nothing is outputted by this action.

Example
1
2
3
4
- windows_server.groups.delete:
    name: example.group
  load:
    windows_server: windows_server

windows_server.groups.

display

Display groups in a table.

The table will have the following columns:

  • Name
  • Description

Minimum Plugin Version: 3.0.0

Input
  • text: the title of the table

  • groups: any number of Groups

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
7
8
9
- windows_server.groups.get_all:
  load:
    windows_server: windows_server
  save: groups

- windows_server.groups.display:
    text: Local Groups
  load:
    groups: groups

windows_server.groups.

display_tabbed

Display groups in a table with multiple tabs.

This action can be used to display group lists from multiple servers.

The table will have the following columns:

  • Name
  • Description

Minimum Plugin Version: 3.0.0

Input
  • text: the title of the table

  • tabs: a dictionary where each key is a tab name & each value is any number of Groups

Output

Nothing is outputted by this action.

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
- set:
    name: tabs
    value: {}

- windows_server.groups.get_all:
  load:
    windows_server: windows_server
  save: all_groups

- ppa_tools.dictionaries.insert:
    name: My Server
  load:
    value: all_groups
    dictionary: tabs
  save: tabs

- windows_server.groups.display_tabbed:
    text: All Local Groups
  load:
    tabs: tabbed_table

windows_server.groups.

get_all

Get all local groups from a Windows Server.

Minimum Plugin Version: 2.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
Output

A list of Groups.

Example
1
2
3
4
- windows_server.groups.get_all:
  load:
    windows_server: windows_server
  save: all_groups

windows_server.groups.

get_by_name

Get a local group from a Windows Server.

Minimum Plugin Version: 10.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • name: the name of the group to get

Output

A single Group.

Example
1
2
3
4
5
- windows_server.groups.get_by_name:
    name: example.group
  load:
    windows_server: windows_server
  save: group

windows_server.groups.

get_domain_groups

Get all domain groups from a local group on a Windows Server.

Minimum Plugin Version: 9.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • group_name: the name of the group

Output

A list of Groups.

Example
1
2
3
4
5
- windows_server.groups.get_domain_groups:
    group_name: Remote Desktop Users
  load:
    windows_server: windows_server
  save: nested_domain_groups

windows_server.groups.

get_domain_users

Get all domain users from a local group on a Windows Server.

Kerberos Authentication Required

This action uses the Get-ADUser cmdlet to resolve domain users in the group.

Kerberos authentication is required for this cmdlet to connect to a Domain Controller.

See Authenticating Using Kerberos for more information.

Minimum Plugin Version: 10.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer configured to use Kerberos authentication

  • group_name: the name of the group

Output

A list of DomainUsers.

Example
1
2
3
4
5
- windows_server.groups.get_domain_users:
    group_name: Remote Desktop Users
  load:
    windows_server: windows_server
  save: domain_users

windows_server.groups.

get_local_users

Get all local users from a local group on a Windows Server.

Minimum Plugin Version: 10.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • group_name: the name of the group

Output

A list of LocalUsers.

Example
1
2
3
4
5
- windows_server.groups.get_local_users:
    group_name: Remote Desktop Users
  load:
    windows_server: windows_server
  save: local_users

windows_server.groups.

remove_domain_group

Remove a domain group from a local group on a Windows Server.

This action will succeed if the domain group is not a member of the local group.

Minimum Plugin Version: 7.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • domain_group_name: the name of the group in domain\groupname format

  • local_group_name: the name of the local group

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
7
- windows_server.group.remove_domain_group:
    local_group_name: local.group
    # The syntax below escapes the backslash for you
    domain_group_name: >
      domain\example.group
  load:
    windows_server: windows_server

windows_server.groups.

remove_user

Remove a user from a local group on a Windows Server.

This action will succeed if the user is not a member of the local group.

Minimum Plugin Version: 10.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • user_name: a local username or a domain username in domain\username or username@fqdn format

  • group_name: the name of the local group to remove the user from

Output

Nothing is outputted by this action.

Removing a Local User
1
2
3
4
5
- windows_server.groups.remove_user:
    user_name: example.user
    group_name: example.group
  load:
    windows_server: windows_server
Removing a Domain User
1
2
3
4
5
6
7
- windows_server.groups.remove_user:
    group_name: example.group
    # The syntax below escapes the backslash for you
    user_name: >
      domain\example.user
  load:
    windows_server: windows_server

windows_server.groups.

select

Display groups in a table & prompt the task operator to make a selection.

The table will have the following columns:

  • Name
  • Description

Minimum Plugin Version: 3.0.0

Input
  • text: the title of the table

  • groups: any number of Groups

  • minimum: the minimum number of selections

  • maximum: the maximum number of selections

Output

A Selection containing:

  • total: the number of selected Groups

  • all: a list of selected Groups

  • first: the first selected Group

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
- windows_server.groups.get_all:
  load:
    windows_server: windows_server
  save: groups

- windows_server.groups.select:
    text: Select Groups
  load:
    groups: groups
  save: selection

windows_server.groups.

select_one

Display groups in a table & prompt the task operator to select one.

The table will have the following columns:

  • Name
  • Description

Minimum Plugin Version: 3.0.0

Input
  • text: the title of the table

  • groups: any number of Groups

Output

A single Group.

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
- windows_server.groups.get_all:
  load:
    windows_server: windows_server
  save: groups

- windows_server.groups.select_one:
    text: Select a Group
  load:
    groups: groups
  save: group