ESXi NTP Konfiguration per PowerCLI

Folgende Zeilen sind dazu per PowerCLI auszuführen:

Connect-VIServer <vCenter-IP-oder-FQDN>
$VMHosts=Get-VMHost [-Location <Clustername>
Add-VmHostNtpServer <NTP1,NTP2> -VMHost $VMHosts
Get-VMHostFirewallException -VMHost $VMHosts | where {$_.Name -eq "NTP client"} | Set-VMHostFirewallException -Enabled:$true
Get-VmHostService -VMHost $VMHosts | Where-Object {$_.key -eq "ntpd"} | Start-VMHostService
Get-VmHostService -VMHost $VMHosts | Where-Object {$_.key -eq "ntpd"} | Set-VMHostService -policy "on"