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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.