From 71e70e50c51249bb10f6203414948b325acc2b2a Mon Sep 17 00:00:00 2001 From: Marc05 <1699133+Marc05@users.noreply.github.com> Date: Fri, 20 Aug 2021 17:21:08 +0000 Subject: [PATCH] Fix NTP configuration before running the service (#72) Co-authored-by: Marc05 --- src/application/collections/windows.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/application/collections/windows.yaml b/src/application/collections/windows.yaml index 9b7e5c26..f0db8e7d 100644 --- a/src/application/collections/windows.yaml +++ b/src/application/collections/windows.yaml @@ -4342,23 +4342,23 @@ actions: code: |- :: Configure time source w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org" - :: Restart time service if running + :: Stop time service if running SC queryex "w32time"|Find "STATE"|Find /v "RUNNING">Nul||( net stop w32time - net start w32time ) - :: Sync now + :: Start time service and sync now + net start w32time w32tm /config /update w32tm /resync revertCode: |- :: Configure time source w32tm /config /syncfromflags:manual /manualpeerlist:"time.windows.com" - :: Restart time service if running + :: Stop time service if running SC queryex "w32time"|Find "STATE"|Find /v "RUNNING">Nul||( net stop w32time - net start w32time ) - :: Sync now + :: Start time servie and sync now + net start w32time w32tm /config /update w32tm /resync -