win_domain_user – Manages Windows Active Directory user accounts¶
New in version 2.4.
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
- win_domain – Ensures the existence of a Windows domain
- The official documentation on the win_domain module.
- win_domain_controller – Manage domain controller/member server state for a Windows host
- The official documentation on the win_domain_controller module.
- win_domain_computer – Manage computers in Active Directory
- The official documentation on the win_domain_computer module.
- win_domain_group – Creates, modifies or removes domain groups
- The official documentation on the win_domain_group module.
- win_domain_membership – Manage domain/workgroup membership for a Windows host
- The official documentation on the win_domain_membership module.
- win_user – Manages local Windows user accounts
- The official documentation on the win_user module.
- win_user_profile – Manages the Windows user profiles
- The official documentation on the win_user_profile module.
Examples¶
- name: Ensure user bob is present with address information
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
win_domain_user:
name: bob
firstname: Bob
surname: Smith
password: B0bP4ssw0rd
state: present
domain_username: DOMAIN\admin-account
domain_password: SomePas2w0rd
domain_server: domain@DOMAIN.COM
- name: Ensure user bob is present in OU ou=test,dc=domain,dc=local
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
win_domain_user:
name: bob
state: absent
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Nick Chandler (@nwchandler)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.