🐛 fixed changing time server not working
This commit is contained in:
@@ -2253,18 +2253,33 @@ actions:
|
|||||||
code: dism /online /Remove-Capability /CapabilityName:"XPS.Viewer~~~~0.0.1.0" /NoRestart
|
code: dism /online /Remove-Capability /CapabilityName:"XPS.Viewer~~~~0.0.1.0" /NoRestart
|
||||||
-
|
-
|
||||||
category: Advanced settings
|
category: Advanced settings
|
||||||
|
docs: https://www.pool.ntp.org/en/use.html
|
||||||
children:
|
children:
|
||||||
-
|
-
|
||||||
name: Change NTP (time) server to pool.ntp.org
|
name: Change NTP (time) server to pool.ntp.org
|
||||||
recommend: false
|
recommend: false
|
||||||
code: |-
|
code: |-
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\Parameters" /v "NtpServer" /t REG_SZ /d "pool.ntp.org, 0x8" /f
|
:: Configure time source
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\Parameters" /v "Type" /t REG_SZ /d "NTP" /f
|
w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org"
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "CrossSiteSyncFlags" /t REG_DWORD /d 2 /f
|
:: Restart time service if running
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "EventLogFlags" /t REG_DWORD /d 0 /f
|
SC queryex "w32time"|Find "STATE"|Find /v "RUNNING">Nul||(
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "ResolvePeerBackoffMaxTimes" /t REG_DWORD /d 7 /f
|
net stop w32time
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "ResolvePeerBackoffMinutes" /t REG_DWORD /d 15 /f
|
net start w32time
|
||||||
reg add "HKLM\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "SpecialPollInterval" /t REG_DWORD /d 1024 /f
|
)
|
||||||
|
:: 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
|
name: Disable Reserved Storage for updates
|
||||||
recommend: false
|
recommend: false
|
||||||
|
|||||||
Reference in New Issue
Block a user