Home > PowerCLI > Amending NTP Servers with PowerCLI

Amending NTP Servers with PowerCLI

$NTPServers = "10.1.1.1","10.1.1.2"
Get-Cluster "MyCluster*" | Get-VMHost | Sort Name | %{
$_ | Remove-VMHostNtpServer -NtpServer ($_ | Get-VMHostNtpServer) -Confirm:$false
$_ | Add-VMHostNtpServer -NtpServer $NTPServers
$_ | Get-VMHostService | Where-Object {$_.key -eq "ntpd"} | Restart-VMHostService -Confirm:$false
}
Categories: PowerCLI Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.
 

Time limit is exhausted. Please reload the CAPTCHA.