From 6085075e2653d84c420433f84d04f569a7804a88 Mon Sep 17 00:00:00 2001 From: "mhorak@totalservice.cz" Date: Tue, 9 Sep 2025 09:47:31 +0200 Subject: [PATCH] version 3.6 --- patch-dc-controllers.yaml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/patch-dc-controllers.yaml b/patch-dc-controllers.yaml index ed4102e..4691072 100644 --- a/patch-dc-controllers.yaml +++ b/patch-dc-controllers.yaml @@ -1,19 +1,11 @@ -- name: Patch Domain Controllers via JEA - hosts: domain_controllers - gather_facts: no - tasks: - - name: Get available updates - win_shell: | - Invoke-Command -ConfigurationName DCMaintenance -ScriptBlock { Get-WindowsUpdate } - - name: Install updates - win_shell: | - Invoke-Command -ConfigurationName DCMaintenance -ScriptBlock { Install-WindowsUpdate -AcceptAll -AutoReboot } +- name: Get available updates + win_powershell: Get-WindowsUpdate +- name: Install updates + win_powershell: Install-WindowsUpdate -AcceptAll -AutoReboot - - name: Get update history - win_shell: | - Invoke-Command -ConfigurationName DCMaintenance -ScriptBlock { Get-WUHistory } +- name: Get update history + win_powershell: Get-WUHistory +- name: Restart domain controller + win_powershell: Restart-Computer -Force - - name: Restart domain controller - win_shell: | - Invoke-Command -ConfigurationName DCMaintenance -ScriptBlock { Restart-Computer -Force }