Syncing DC time with the internet

Hi Experts,

I need a script to sync my DC with internet time, and need assistance writing one, if you could please post any you use or any recommendations that would be great!

Look forward to reading your posts.
isdd2000Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tony GiangrecoCommented:
This works great for us

net stop w32time
net start w32time
w32tm /config /manualpeerlist:129.6.15.28,0x8 /syncfromflags:MANUAL /reliable:yes /update
w32tm /resync /rediscover
net stop w32time
net start w32time
0
Seth SimmonsSr. Systems AdministratorCommented:
is there a specific reason you need to script it this way instead of configuring the time service on the PDC to do it automatically?
0
Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
What TG-TIS said is correct but this must be done on PDC Emulator for the forest only as this is the time source for the whole forest.  All other DCs will be synchronizing their time with the PDC Emulator for the forest.  I usually use Windows Time server and below is what I run on the Forest PDC Emulator:

W32tm /config /manualpeerlist:time.windows.com /syncfromflags:manual /reliable:yes /update
W32tm /resync /rediscover
Net stop w32time && net start w32time
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

isdd2000Author Commented:
Hi Guys,

Thanks so much for your feedback!
The ideally is just to make sure that the DC time is always accurate so it can replicate to other machines.

If i want to perform a manual sync i can use the command "W32tm /resync" is that correct?
0
Mohammed TahirMicrosoft Exchange and O365 AdministratorCommented:
Yes for manual time sync you have to ran "W32tm /Resync" command.


Tahir
0
Tony GiangrecoCommented:
Yes, we have that script saved as time.cmd and have in the scheduled tasks that runs every 12 hours. Our time is always perfect on 40 desktops and five servers in our domain.

Hope this helps!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
isdd2000Author Commented:
I found I had to run the following first before I could run the single line resync

net stop w32time
net start w32time
w32tm /config /manualpeerlist:129.6.15.28,0x8 /syncfromflags:MANUAL /reliable:yes /update
w32tm /resync /rediscover
net stop w32time
net start w32time
0
Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
PCs on a domain sync their time with the DCs, why do you want to schedule a script is beyond me.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.