community.windows.win_domain_user – Manages Windows Active Directory user accounts¶
Note
This plugin is part of the community.windows collection (version 1.3.0).
To install it use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_domain_user
.
Parameters¶
Notes¶
Note
Works with Windows 2012R2 and newer.
If running on a server that is not a Domain Controller, credential delegation through CredSSP or Kerberos with delegation must be used or the domain_username, domain_password must be set.
Note that some individuals have confirmed successful operation on Windows 2008R2 servers with AD and AD Web Services enabled, but this has not received the same degree of testing as Windows 2012R2.
See Also¶
See also
- ansible.windows.win_domain
The official documentation on the ansible.windows.win_domain module.
- ansible.windows.win_domain_controller
The official documentation on the ansible.windows.win_domain_controller module.
- community.windows.win_domain_computer
The official documentation on the community.windows.win_domain_computer module.
- 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_user
The official documentation on the ansible.windows.win_user module.
- community.windows.win_user_profile
The official documentation on the community.windows.win_user_profile module.
Examples¶
- name: Ensure user bob is present with address information
community.windows.win_domain_user:
name: bob
firstname: Bob
surname: Smith
company: BobCo
password: B0bP4ssw0rd
state: present
groups:
- Domain Admins
street: 123 4th St.
city: Sometown
state_province: IN
postal_code: 12345
country: US
attributes:
telephoneNumber: 555-123456
- name: Ensure user bob is created and use custom credentials to create the user
community.windows.win_domain_user:
name: bob
firstname: Bob
surname: Smith
password: B0bP4ssw0rd
state: present
domain_username: DOMAIN\admin-account
domain_password: SomePas2w0rd
domain_server: [email protected]
- name: Ensure user bob is present in OU ou=test,dc=domain,dc=local
community.windows.win_domain_user:
name: bob
password: B0bP4ssw0rd
state: present
path: ou=test,dc=domain,dc=local
groups:
- Domain Admins
- name: Ensure user bob is absent
community.windows.win_domain_user:
name: bob
state: absent
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Nick Chandler (@nwchandler)