How to configure windows to continuously sync time with a known ip using powershell
<p>Every time I add a computer to my network I run a script to set everything up as needed. One of the actions I need to perform is making the new computer's clock synchronize with a certain computer on the network (i.e. ip x.x.x.x).</p>
<p>I know I could make it sync once using:</p>
<pre><code>NET TIME \\x.x.x.x /SET /Y
</code></pre>
<p>But I want the computers to stay synced with x.x.x.x (as would happen with an internet server if I manually chose &quot;synchronize with an internet time server&quot; in &quot;internet time settings&quot;).</p>
<p>Is there a Powershell command that will change Windows' settings so it will keep sync with x.x.x.x?
(I know I can write a script to run the above command e.g. every day and make it run on startup on each of the machines on the network, but I prefer adding a line (or a couple) to the script I run once when setting up a new machine)</p>
<p>Thank you!</p>