ansible / ansible.builtin / v2.9.27 / module / win_user_profile Manages the Windows user profiles. | "added in version" 2.8 of ansible.builtin" Authors: Jordan Borean (@jborean93) preview | supported by communityansible.builtin.win_user_profile (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
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.
- name: Create a profile for an account win_user_profile: username: ansible-account state: present
- name: Create a profile for an account at C:\Users\ansible win_user_profile: username: ansible-account name: ansible state: present
- name: Remove a profile for a still valid account win_user_profile: username: ansible-account state: absent
- name: Remove a profile for a deleted account win_user_profile: name: ansible state: absent
- name: Remove a profile for a deleted account based on the SID win_user_profile: username: S-1-5-21-3233007181-2234767541-1895602582-1305 state: absent
- name: Remove multiple profiles that exist at the basename path win_user_profile: name: ansible state: absent remove_multiple: yes
name: description: - Specifies the base name for the profile path. - When I(state) is C(present) this is used to create the profile for I(username) at a specific path within the profile directory. - This cannot be used to specify a path outside of the profile directory but rather it specifies a folder(s) within this directory. - If a profile for another user already exists at the same path, then a 3 digit incremental number is appended by Windows automatically. - When I(state) is C(absent) and I(username) is not set, then the module will remove all profiles that point to the profile path derived by this value. - This is useful if the account no longer exists but the profile still remains. type: str state: choices: - absent - present default: present description: - Will ensure the profile exists when set to C(present). - When creating a profile the I(username) option must be set to a valid account. - Will remove the profile(s) when set to C(absent). - When removing a profile either I(username) must be set to a valid account, or I(name) is set to the profile's base name. type: str username: description: - The account name of security identifier (SID) for the profile. - This must be set when I(state) is C(present) and must be a valid account or the SID of a valid account. - When I(state) is C(absent) then this must still be a valid account number but the SID can be a deleted user's SID. remove_multiple: default: false description: - When I(state) is C(absent) and the value for I(name) matches multiple profiles the module will fail. - Set this value to C(yes) to force the module to delete all the profiles found. type: bool
path: description: The full path to the profile for the account. This will be null if C(state=absent) and no profile was deleted. returned: always sample: C:\Users\ansible type: str