So I’m part the way through sorting out my new spanky AD on Windows 2012 using Hyper-V and I start to notice time drift. Not just a little either, we’re slipping minutes a day.
Now usually this would be simple, we just tell the time server master a la PDC emulator to go out the interwebz and grab the time. Uh Uh Uh, you’re running your PDC emulator on a VM baby and it’s definitely grabbing it’s time from the VM Node. Okay, we’ll just update the VM Node time via the interwebz then…. Uh Uh Uh, it’s a member of your domain so it’s getting the time from the PDC emulator.
Yup, and so begins the circle of death by W32tm. Luckily, you can break out the cycle. Per DC and including the VM Nodes, run this bad boy:
@echo off
cls
echo TIME SOURCE SET
echo ===============
echo.
echo Finding PDC…
:: Retrieve PDC name; delims is a dot, followed by a space and a tab
for /f “tokens=2 delims=. ” %%A IN (‘netdom query /domain:%USERDOMAIN% fsmo 2^>NUL ^| find.exe “PDC”‘) DO SET PDC=%%A
IF NOT DEFINED PDC GOTO NoPdcFoundecho Turning off VM Sync
:: Turn off VM Time
reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider /v Enabled /t reg_dword /d 0:: Check if this machine is a PDC
if NOT %COMPUTERNAME%==%%A goto DCTIME
:: PDC Stuff:: Get time from Internet
echo Setting time server
w32tm /config /manualpeerlist:“0.pool.ntp.org,0x1” /syncfromflags:MANUAL /reliable:yes:: Set the time
echo Setting the system time
w32tm /config /update w32tm /resync w32tm /resync /rediscover
goto end:DCTIME
:: Set the time
w32tm /config /update w32tm /resync w32tm /resync /rediscover:: Check the system
w32tm /query /status
w32tm /query /sourcew32tm /config /syncfromflags:DOMHIER /update
net stop w32time
net start w32time
w32tm /resync /forcegoto end
:NoPdcFound
echo Cannot find your PDC. Quitting
pause
exit
:end
echo Time services set
pause
From the top, it disables getting time from the VM Node/Host/Hardware. It finds the PDC and if it is running on it then sets the time source to the internet time keepers. If not, it sets the time to come from the domain PDC which in turn is getting it’s time from the web time watchers.
Issue cured.
this script fails…
TIME SOURCE SET
===============
Finding PDCà
2 was unexpected at this time.
C:\Users\Administrator>
Your website must give you a clear message using a goal-oriented direction, setting you apart from your
competition. The truth is, people join MLM opportunities because of who introduced them.
” Employees at Nike are encouraged to get curious and offered to new ideas, whatever their source.
Look at my homepage … business – worldofmercenaries.pl –