ansible.windows.win_group_membership – Manage Windows local group membership¶
Note
This plugin is part of the ansible.windows collection (version 1.4.0).
To install it use: ansible-galaxy collection install ansible.windows
.
To use it in a playbook, specify: ansible.windows.win_group_membership
.
Synopsis¶
Allows the addition and removal of local, service and domain users, and domain groups from a local group.
Parameters¶
See Also¶
See also
- community.windows.win_domain_group
The official documentation on the community.windows.win_domain_group module.
- ansible.windows.win_domain_membership
The official documentation on the ansible.windows.win_domain_membership module.
- ansible.windows.win_group
The official documentation on the ansible.windows.win_group module.
Examples¶
- name: Add a local and domain user to a local group
ansible.windows.win_group_membership:
name: Remote Desktop Users
members:
- NewLocalAdmin
- DOMAIN\TestUser
state: present
- name: Remove a domain group and service user from a local group
ansible.windows.win_group_membership:
name: Backup Operators
members:
- DOMAIN\TestGroup
- NT AUTHORITY\SYSTEM
state: absent
- name: Ensure only a domain user exists in a local group
ansible.windows.win_group_membership:
name: Remote Desktop Users
members:
- DOMAIN\TestUser
state: pure
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Andrew Saraceni (@andrewsaraceni)