Configuring the Time Source

To configure the time source on a computer, you have two options. The first is to use the net time command, and the second is to edit the registry. Since the net time command is able to remote, I prefer the first method. But for the sake of completeness, I will show you how to query the registry key to ensure the change was successful. This registry key value is shown in Figure 10-4.

The time source in the registry.

Figure 10-4. The time source in the registry.

Using the Net Time Command

In the SetTimeSource.ps1 script, use the param statement to define four command-line parameters. The first is the -computer parameter that determines where the script runs. ...

Get Windows PowerShell™ Scripting Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.