New in version 2.8.
| Parameter | Choices/Defaults | Comments | 
|---|---|---|
| domain_password  string  | The password for username. | |
| domain_server  string  | Specifies the Active Directory Domain Services instance to connect to. Can be in the form of an FQDN or NetBIOS name. If not specified then the value is based on the domain of the computer running PowerShell. | |
| domain_username  string  | The username to use when interacting with AD. If this is not set then the user Ansible used to log in with will be used instead when using CredSSP or Kerberos with credential delegation. | |
| members  list / required  | A list of members to ensure are present/absent from the group. The given names must be a SamAccountName of a user, group, service account, or computer. For computers, you must add "$" after the name; for example, to add "Mycomputer" to a group, use "Mycomputer$" as the member. | |
| name  string / required  | Name of the domain group to manage membership on. | |
| state  string  | 
 | Desired state of the members in the group. When  stateispure, only the members specified will exist, and all other existing members not specified are removed. | 
Note
See also
- name: Add a domain user/group to a domain group
  win_domain_group_membership:
    name: Foo
    members:
      - Bar
    state: present
- name: Remove a domain user/group from a domain group
  win_domain_group_membership:
    name: Foo
    members:
      - Bar
    state: absent
- name: Ensure only a domain user/group exists in a domain group
  win_domain_group_membership:
    name: Foo
    members:
      - Bar
    state: pure
- name: Add a computer to a domain group
  win_domain_group_membership:
    name: Foo
    members:
      - DESKTOP$
    state: present
   Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description | 
|---|---|---|
| added  list  | success and stateispresentorpure | A list of members added when  stateispresentorpure; this is empty if no members are added.Sample: ['UserName', 'GroupName'] | 
| members  list  | success | A list of all domain group members at completion; this is empty if the group contains no members. Sample: ['UserName', 'GroupName'] | 
| name  string  | always | The name of the target domain group. Sample: Domain-Admins | 
| removed  list  | success and stateisabsentorpure | A list of members removed when  stateisabsentorpure; this is empty if no members are removed.Sample: ['UserName', 'GroupName'] | 
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
    © 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
    https://docs.ansible.com/ansible/2.9/modules/win_domain_group_membership_module.html