From c19691d6297303f1c548e2f0577697b0ef748f1f Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 1 Jan 2023 04:15:42 +0100 Subject: [PATCH] Fix UAC --- tasks/ansible_user.yml | 6 ++++++ 1 file changed, 6 insertions(+) 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