Share via


Set-HcsNtpClientServerAddress

Set-HcsNtpClientServerAddress

Sets the NTP URLs for this device.

語法

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

詳細描述

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.

參數

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

別名

必要?

false

位置?

named

預設值

接受管線輸入?

false

接受萬用字元?

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.

別名

必要?

false

位置?

named

預設值

接受管線輸入?

false

接受萬用字元?

false

-Confirm

執行 Cmdlet 之前先提示您確認。

必要?

false

位置?

named

預設值

false

接受管線輸入?

false

接受萬用字元?

false

-WhatIf

顯示執行 Cmdlet 後會發生的情況。未執行 Cmdlet。

必要?

false

位置?

named

預設值

false

接受管線輸入?

false

接受萬用字元?

false

<CommonParameters>

此 Cmdlet 支援一般參數:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 與 -OutVariable。如需詳細資訊,請參閱 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

輸入

輸入類型是您可以使用管線處理方式傳遞給 Cmdlet 的物件類型。

輸出

輸出類型是 Cmdlet 所發出的物件類型。

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

    The NtpInfo object has the following properties:

    -- String Primary
    -- String[] Secondary

範例

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