Manages the Windows user profiles.
- Used to create or remove user profiles on a Windows host.
- This can be used to create a profile before a user logs on or delete a profile when removing a user account.
- A profile can be created for both a local or domain account.
.. seealso:: :ref:`ansible.windows.win_user_module` The official documentation on the **ansible.windows.win_user** module. :ref:`community.windows.win_domain_user_module` The official documentation on the **community.windows.win_domain_user** module.
- name: Create a profile for an account
community.windows.win_user_profile:
username: ansible-account
state: present
- name: Create a profile for an account at C:\Users\ansible
community.windows.win_user_profile:
username: ansible-account
name: ansible
state: present
- name: Remove a profile for a still valid account
community.windows.win_user_profile:
username: ansible-account
state: absent
- name: Remove a profile for a deleted account
community.windows.win_user_profile:
name: ansible
state: absent
- name: Remove a profile for a deleted account based on the SID
community.windows.win_user_profile:
username: S-1-5-21-3233007181-2234767541-1895602582-1305
state: absent
- name: Remove multiple profiles that exist at the basename path
community.windows.win_user_profile:
name: ansible
state: absent
remove_multiple: yes
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
path
string
|
always |
The full path to the profile for the account. This will be null if
state=absent and no profile was deleted.Sample:
C:\Users\ansible
|
- Jordan Borean (@jborean93)