From c69998c7cb29ffcf40f0af03b73150736581da69 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Sun, 16 Aug 2020 03:31:49 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fixed=20changing=20time=20server?= =?UTF-8?q?=20not=20working?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/application/application.yaml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/application/application.yaml b/src/application/application.yaml index 89087528..a57d176a 100644 --- a/src/application/application.yaml +++ b/src/application/application.yaml @@ -2253,18 +2253,33 @@ actions: code: dism /online /Remove-Capability /CapabilityName:"XPS.Viewer~~~~0.0.1.0" /NoRestart - category: Advanced settings + docs: https://www.pool.ntp.org/en/use.html children: - name: Change NTP (time) server to pool.ntp.org recommend: false code: |- - reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\Parameters" /v "NtpServer" /t REG_SZ /d "pool.ntp.org, 0x8" /f - reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\Parameters" /v "Type" /t REG_SZ /d "NTP" /f - reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "CrossSiteSyncFlags" /t REG_DWORD /d 2 /f - reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "EventLogFlags" /t REG_DWORD /d 0 /f - reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "ResolvePeerBackoffMaxTimes" /t REG_DWORD /d 7 /f - reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "ResolvePeerBackoffMinutes" /t REG_DWORD /d 15 /f - reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "SpecialPollInterval" /t REG_DWORD /d 1024 /f + :: 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 + SC queryex "w32time"|Find "STATE"|Find /v "RUNNING">Nul||( + net stop w32time + net start w32time + ) + :: Sync now + w32tm /config /update + w32tm /resync + revertCode: |- + :: Configure time source + w32tm /config /syncfromflags:manual /manualpeerlist:"time.windows.com" + :: Restart time service if running + SC queryex "w32time"|Find "STATE"|Find /v "RUNNING">Nul||( + net stop w32time + net start w32time + ) + :: Sync now + w32tm /config /update + w32tm /resync - name: Disable Reserved Storage for updates recommend: false