Skip to content

Windows Server Windows Server: Users

Summary

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

Actions

windows_server.users.

add_to_group

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

This action will succeed if the user is already 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 group to add them to

Output

Nothing is outputted by this action.

Adding a Local User
1
2
3
4
5
- windows_server.users.add_to_group:
    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.users.add_to_group:
    group_name: example.group
    # The syntax below escapes the backslash for you
    user_name: >
      domain\example.user
  load:
    windows_server: windows_server

windows_server.users.

create

Create a user on a Windows Server.

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

Minimum Plugin Version: 7.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • name: the username

  • full_name: new user's full name

  • password: a password for the user

  • enabled: set to false to create the user in a disabled state (defaults to true)

  • description: an optional description for the user

  • password_never_expires: set to true to prevent the user's password expiring (defaults to false)

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
7
- windows_server.users.create:
    name: example.user
    full_name: Example User
    description: Created by PPA
  load:
    password: new_password
    windows_server: windows_server

windows_server.users.

delete

Delete a user on a Windows Server.

This action will succeed if the supplied user does not exist.

Minimum Plugin Version: 7.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • name: username of the user to delete

Output

Nothing is outputted by this action.

Example
1
2
3
4
- windows_server.users.delete:
    name: example.user
  load:
    windows_server: windows_server

windows_server.users.

disable

Disable a local user on a Windows Server.

Minimum Plugin Version: 7.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • name: username of the user to disable

Output

Nothing is outputted by this action.

Example
1
2
3
4
- windows_server.users.disable:
    name: example.user
  load:
    windows_server: windows_server

windows_server.users.

display

Display users in a table.

The table will have the following columns:

  • Name
  • Full Name
  • Description
  • Enabled
  • Domain User

Minimum Plugin Version: 10.0.0

Input
Output

Nothing is outputted by this action.

Example 1 - Displaying Local Users
1
2
3
4
5
6
7
8
9
- windows_server.users.get_all:
  load:
    windows_server: windows_server
  save: all_users

- windows_server.users.display:
    text: All Local Users
  load:
    users: all_users
Example 2 - Displaying Domain Users In Group
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
- windows_server.groups.get_domain_users:
    group_name: Administrators
  load:
    windows_server: windows_server
  save: domain_users

- windows_server.users.display:
    text: Domain Users in Local Administrators
  load:
    users: domain_users

windows_server.users.

display_tabbed

Display users in a table with multiple tabs.

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

The table will have the following columns:

  • Name
  • Full Name
  • Description
  • Enabled
  • Domain User

Minimum Plugin Version: 3.0.0

Input
  • text: the title of the table

  • tabs: a dictionary with tab names as keys & Users or DomainUsers as values

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.users.get_all:
  load:
    windows_server: windows_server
  save: all_users

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

- windows_server.users.display_tabbed:
    text: All Local Users
  load:
    tabs: tabs

windows_server.users.

enable

Enable a local user on a Windows Server.

Minimum Plugin Version: 7.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • name: username of the user to enable

Output

Nothing is outputted by this action.

Example
1
2
3
4
- windows_server.users.enable:
    name: example.user
  load:
    windows_server: windows_server

windows_server.users.

get_all

Get all local users 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 LocalUsers.

Example
1
2
3
4
- windows_server.users.get_all:
  load:
    windows_server: windows_server
  save: all_users

windows_server.users.

get_by_name

Get a local user 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 user to get

Output

A single LocalUser.

Example
1
2
3
4
5
- windows_server.users.get_by_name:
    name: example.user
  load:
    windows_server: windows_server
  save: user

windows_server.users.

remove_from_group

Remove a local or domain user from a 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 group to remove them from

Output

Nothing is outputted by this action.

Removing a Local User
1
2
3
4
5
- windows_server.users.remove_from_group:
    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.users.remove_from_group:
    # The syntax below escapes the backslash for you
    user_name: >
      domain\example.user
    group_name: example.group
  load:
    windows_server: windows_server

windows_server.users.

select

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

The table will have the following columns:

  • Name
  • Full Name
  • Description
  • Enabled
  • Domain User

Minimum Plugin Version: 3.0.0

Input
  • text: the title of the table

  • users: any number of Users or DomainUsers

  • minimum: the minimum number of selections

  • maximum: the maximum number of selections

Output

A Selection containing:

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

- windows_server.users.select:
    text: Select Users
  load:
    users: users
  save: selection

windows_server.users.

select_one

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

The table will have the following columns:

  • Name
  • Full Name
  • Description
  • Enabled
  • Domain User

Minimum Plugin Version: 3.0.0

Input
Output

A single User or DomainUser

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

- windows_server.users.select_one:
    text: Select a User
  load:
    users: users
  save: user

windows_server.users.

set_password

Set a password for a user on a Windows Server.

Minimum Plugin Version: 7.0.0

Domain Controllers

This action will fail if run against a Domain Controller.

Input
  • windows_server: a WindowsServer

  • name: username of the user to enable

  • password: a new password to set

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- windows_server.users.set_password:
    name: example.user
  load:
    password: new_password
    windows_server: windows_server