In this article we will discuss the main points of working with ntp through Powershell on Windows server 2012. We will do this on the domain controller. So let's get started.
1. Start and stop time service:- Use this commands:
2. Let's specify the server with which we will synchronize time:- Check if our time is synchronized with Microsoft's public ntp server:
3. Let's specify the server with which we will synchronize time:- Check if our time is synchronized with Microsoft's public ntp server:
4. Choose trusted time source:- Now we’ll point out that we have to synchronize with this server and say that we are a trusted time source:
5. Synchronize with several public time sources:- If you need to synchronize with several public time sources, the command will look like this:
6. Several useful commands:- Useful information about time synchronization: w32tm /query /status
Also consider using Action1 to set time remotely if:
- You need to perform this action on multiple (hundreds or even thousands) computers simultaneously.
- Some of your endpoints are laptops not connected to corporate network at all times.