O'Reilly logo

Windows PowerShell™ Scripting Guide by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required