diff --git a/tasks/ansible_user.yml b/tasks/ansible_user.yml index 7eb87d2..a73a031 100644 --- a/tasks/ansible_user.yml +++ b/tasks/ansible_user.yml @@ -22,3 +22,9 @@ password_never_expires: true user_cannot_change_password: true groups: "{{ win_base_init__os_groups }}" + register: _user + +- name: Set UAC to always notify + ansible.windows.win_powershell: + script: 'Set-ItemProperty -Path REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -Value 5' + changed_when: _user.changed