Time is off on PDC/DC server and how to fix it

We have had problems with HyperV and VMware hosts taking over the NTP role for our Primary domains controllers.

On VMware you first have to disable the timesync feature on all your virtual machines, you can do that be running this command.
c:\Program Files\VMware\VMware Tools\VMwareTools\VMwareToolsd.exe timesync disable

On HyperV you can just proceed to finding your PDC by opening your CMD and running netdom query fsmo.

Log on to your PDC and run these commands, in the manualpeerlist you can add the NTP servers for your location, to find NTP servers you can use http://www.pool.ntp.org.

w32tm /config /syncfromflags:manual /manualpeerlist:0.dk.pool.ntp.org,1.dk.pool.ntp.org,2.dk.pool.ntp.org,3.dk.pool.ntp.org /update

reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config /v SpecialInterval /t reg_dword /d 1 /f
reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config /v SpecialPollInterval /t reg_dword /d 60 /f

net stop w32time
net start w32time
w32tm /resync /force

On the other servers run these commands to set the intervals and force a sync.

reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config /v SpecialInterval /t reg_dword /d 1 /f
reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config /v SpecialPollInterval /t reg_dword /d 60 /f

w32tm /config /update
net stop w32time
net start w32time
w32tm /resync /force

To check if the settings is OK you can run w32tm /query /peers, which displays the servers you sync from which should be your PDC server on the other servers.

If not you can force a change by running the command w32tm /config /manualpeerlist:"dc1.contoso.local" "dc2.contose.local" /reliable:yes /
update.

I have tried one time that the time wouldn’t sync on the PDC even though I forced a sync, I then change the time 10 minutes back and resynced which helped.