Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Short version, BAT file for your primary DC etc (Feel free to change swgfl one to another ntp server):

 

  @echo off
net stop w32time
w32tm /config /syncfromflags:manual /manualpeerlist:ntp.swgfl.org.uk
w32tm /config /reliable:yes
net start w32time
w32tm /query /peers
PAUSE

 

Longer version, if it's a VM etc it's likely to be caused by interactions with the hosts and what not so will need more tweaking

 

Steve

  • Thanks 1
Posted
Short version, BAT file for your primary DC etc (Feel free to change swgfl one to another ntp server):

 

  @[u][url="http://www.edugeek.net/member.php?u=16971"]echo[/url][/u] off
net stop w32time
w32tm /config /syncfromflags:manual /manualpeerlist:ntp.swgfl.org.uk
w32tm /config /reliable:yes
net start w32time
w32tm /query /peers
PAUSE

 

Longer version, if it's a VM etc it's likely to be caused by interactions with the hosts and what not so will need more tweaking

 

Steve

 

Thanks

Ok just checked and it is also out on our hyper v server.

Posted

Then you have two options really,

 

Disable time sync on your DCs VMs, and set your HOSTs to sync from the DC and the DC to sync from NTP. (Preferred way really imo) So basically NTP->DC->HOST->non-dcVMs

 

Or sync the HOSTS with NTP and let all VMs sync with time sync as standard, so NTP->HOST->VMs

 

Steve

  • Thanks 1
Posted

Your time source is probably a hardware clock on your server (or one of your servers) that's drifting a bit. All your clients will effectively sync from that. Find the server that's using a system clock as it's time source (rather than another host) and set the time manually on there (or use NTP as @Steve21 suggests): all your clients will then start to align their clocks.

 

Run this command on your server(s) to determine their time source, so that you can track down what syncs from what, and where the authoritative source is.

w32tm /query /source

 

https://time.is/ is a handy site for troubleshooting time syncs.

Posted
Then you have two options really,

 

Disable time sync on your DCs VMs, and set your HOSTs to sync from the DC and the DC to sync from NTP. (Preferred way really imo) So basically NTP->DC->HOST->non-dcVMs

 

Or sync the HOSTS with NTP and let all VMs sync with time sync as standard, so NTP->HOST->VMs

 

Steve

 

Easiest way of doing this?

Posted

Obviously depends on your exact setup as in how many physical servers/dcs etc but the route I went was:

 

HyperV -> DCs - Disable time sync in the advance options so it doesn't use the host as the time.

DCs -> Run scripts setting them to all sync from NTP externally.

HOSTs "should" already pull from your DC just in an endless loop atm as its' VM->HOST-VM etc, if you run the command linked above about source it should say if it's local or domain it's getting it from, if local set HOST to use DC as source.

VMs will just auto sync/pull from HOST then

 

Then either wait a bit or manually sync each and they'll update, huzzah! (Not sure how far they are out in terms of time but if more than a few minutes you might want to force them all else might get auth issues between waiting for sync etc)

 

Steve

  • Thanks 1
Posted
Obviously depends on your exact setup as in how many physical servers/dcs etc but the route I went was:

 

HyperV -> DCs - Disable time sync in the advance options so it doesn't use the host as the time.

DCs -> Run scripts setting them to all sync from NTP externally.

HOSTs "should" already pull from your DC just in an endless loop atm as its' VM->HOST-VM etc, if you run the command linked above about source it should say if it's local or domain it's getting it from, if local set HOST to use DC as source.

VMs will just auto sync/pull from HOST then

 

Then either wait a bit or manually sync each and they'll update, huzzah! (Not sure how far they are out in terms of time but if more than a few minutes you might want to force them all else might get auth issues between waiting for sync etc)

 

Steve

 

Ok the hyper v server is looking at our dc for time. The dc however is looking at vm ic time synchronization provider for it's time.

Posted

Then in the advanced settings for the DC, disable the time one. Set that BAT file on it, and check if it's updating externally ok. (Firewall wise etc).

 

Then rest should magically work! :p (always the theory)

 

Steve

  • Thanks 1
Posted
Then in the advanced settings for the DC, disable the time one. Set that BAT file on it, and check if it's updating externally ok. (Firewall wise etc).

 

Then rest should magically work! :p (always the theory)

 

Steve

 

Sorry new to hyper V where are the advanced settings located in the hyper v manager?

Posted

Depending which view you have on, if you just right click on the VM, go settings, there should be an integration services tab. And one should be time sync (basically the sync from host)

 

Steve

  • Thanks 1
Posted
Depending which view you have on, if you just right click on the VM, go settings, there should be an integration services tab. And one should be time sync (basically the sync from host)

 

Steve

Ok Perfect. So just before i start this you are saying untick that then log onto the dc and run the batch script you gave me and then in theory should be good?

Posted (edited)

Basically. (can't remember if it needs a restart of not as ages ago I did mine). (And you might want to pick a random NTP server from the standard ones if you aren't on SWGFL etc)

 

If the HOSTs already point at the DC they'll pick up the updated time, and sync it down to VMs. So as long as DC is updated and firewall etc is happy should all be cheers around!

 

You can re-run this command on it to test on it once you run the BAT file and it'll tell you if it worked as it'll show the address as the source

w32tm /query /configuration 
and
w32tm /query /peers

upload a screenie of it after it's done if you want a double check

 

Steve

Edited by Steve21
  • Thanks 1
Posted (edited)
Basically. (can't remember if it needs a restart of not as ages ago I did mine). (And you might want to pick a random NTP server from the standard ones if you aren't on SWGFL etc)

 

If the HOSTs already point at the DC they'll pick up the updated time, and sync it down to VMs. So as long as DC is updated and firewall etc is happy should all be cheers around!

 

You can re-run this command on it to test on it once you run the BAT file and it'll tell you if it worked as it'll show the address as the source

w32tm /query /configuration 
and
w32tm /query /peers

upload a screenie of it after it's done if you want a double check

 

Steve

Thanks

 

Would you use something like server 0.uk.pool.ntp.org

 

Edit:

 

So would look like this

 

@echo off

net stop w32time

w32tm /config /syncfromflags:manual /manualpeerlist:0.uk.pool.ntp.org

w32tm /config /reliable:yes

net start w32time

w32tm /query /peers

PAUSE

 

Thanks

Edited by Shadow_Walker
Posted

If you mean by just leaving it it depends on the timeout on the clients.

 

You can just run w32tm /resync on one to test and make sure it's syncing though (Just in case it's too far out of time and needs another setting tweaked)

 

Steve

  • Thanks 1
Posted
If you mean by just leaving it it depends on the timeout on the clients.

 

You can just run w32tm /resync on one to test and make sure it's syncing though (Just in case it's too far out of time and needs another setting tweaked)

 

Steve

Time is spot on the DC. It has filtered down to some clients already but the hyper V server is still out so best off just waiting?

Posted

I'd still run that just in case, at least on one. Sometimes if it's too far out of sync it gets upset and needs a force to update that big a time change (sort of a catch all in case something breaks).

 

There's no real harm in waiting or re-syncing it (I normally force the important stuff and leave the clients etc)

 

It should show under the w32tm /query /peers how long is left for it to retest. Like 390.2054835s on mine currently! :p

 

Steve

Posted
I'd still run that just in case, at least on one. Sometimes if it's too far out of sync it gets upset and needs a force to update that big a time change (sort of a catch all in case something breaks).

 

There's no real harm in waiting or re-syncing it (I normally force the important stuff and leave the clients etc)

 

It should show under the w32tm /query /peers how long is left for it to retest. Like 390.2054835s on mine currently! :p

 

Steve

 

My host has gone past the reset and still will not change still.

 

State: ActiveTime Remaining: 11.2609088sMode: 3 (Client)Stratum: 4 (secondary reference - syncd by (S)NTP)PeerPoll Interval: 6 (64s)HostPoll Interval: 6 (64s)

Posted
Restart the Windows Time service? I've had to do that with some of mine on occasions to get them to begin to budge. Large time differences won't get adjusted in one go, it'll sorta half the difference again and again for a few minutes until it becomes aligned.
Posted

If you do a w32tm /monitor on the HyperV server what level stratum are your DCs?

 

As said above, sometimes the clients need restarting to reset their level back down to accept a higher (or lower depending on your phrase) rank

 

Steve

Posted
If you do a w32tm /monitor on the HyperV server what level stratum are your DCs?

 

As said above, sometimes the clients need restarting to reset their level back down to accept a higher (or lower depending on your phrase) rank

 

Steve

 

I restarted the time service on the host and now it all seems to be working. Fingers crossed for tomorrow!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...