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).
I know I could make it sync once using:
NET TIME \\x.x.x.x /SET /Y
But I want the computers to stay synced with x.x.x.x (as would happen with an internet server if I manually chose "synchronize with an internet time server" in "internet time settings").
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)
Thank you!