Set-HcsNtpClientServerAddress

Set-HcsNtpClientServerAddress

Sets the NTP URLs for this device.

Syntax

Parameter Set: Default
Set-HcsNtpClientServerAddress [-Primary <String> ] [-Secondary <String[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Set-HcsNtpClientServerAddress cmdlet sets the Network Time Protocol (NTP) URLs for this device. You can set one primary URL and several optional secondary URLs.

Parameters

-Primary<String>

Specifies the primary NTP server address. The device uses this server unless it is not available. You can change the primary address, but you cannot remove it.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Secondary<String[]>

Specifies an array of secondary NTP server addresses. If the primary NTP server does not respond, the device tries the secondary addresses in order.

If you specify a value for this parameter, this cmdlet replaces the entire list of secondary servers with the array that you specify. The cmdlet does not append the servers to the current array of secondary servers.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.HCS.Management.Powershell.Cmdlets.NtpInfo

    The NtpInfo object has the following properties:

    -- String Primary
    -- String[] Secondary

Examples

Example 1: Set primary and secondary NTP servers

This command sets the primary and secondary NTP servers for your device.

PS C:\> Set-HcsNtpClientServerAddress -Primary "time.contoso.com" -Secondary "secondary.contoso.com"

Example 2: Set primary NTP server

This command sets the primary NTP server for your device.

PS C:\> Set-HcsNtpClientServerAddress -Primary "time.contoso.com"

Example 3: Set secondary NTP server

This command sets the secondary NTP server for your device.

PS C:\> Set-HcsNtpClientServerAddress -Secondary "secondary.contoso.com"

Get-HcsNtpClientServerAddress