Set-HcsNtpClientServerAddress
Sets the NTP URLs for this device.
Syntax
Set-HcsNtpClientServerAddress
[-Primary <String>]
[-Secondary <String[]>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
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.
Examples
Example 1: Set primary and secondary NTP servers
PS C:\> Set-HcsNtpClientServerAddress -Primary "time.contoso.com" -Secondary "secondary.contoso.com"
Primary Secondary
------- ---------
time.contoso.com {secondary.contoso.com}
This command sets the primary and secondary NTP servers for your device.
Example 2: Set primary NTP server
PS C:\> Set-HcsNtpClientServerAddress -Primary "time.contoso.com"
Primary Secondary
------- ---------
time.contoso.com {secondary.contoso.com}
This command sets the primary NTP server for your device.
Example 3: Set secondary NTP server
PS C:\> Set-HcsNtpClientServerAddress -Secondary "secondary.contoso.com"
Primary Secondary
------- ---------
time.contoso.com {secondary.contoso.com}
This command sets the secondary NTP server for your device.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Primary
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.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Secondary
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.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Outputs
Microsoft.HCS.Management.Powershell.Cmdlets.NtpInfo
The NtpInfo object has the following properties:
- String Primary
- String[] Secondary
Related Links
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för