Checking VMware NTP configuration with Powershell

Thanks to the VMware VI Toolkit 1.5, checking the NTP settings on all your VMware ESX Servers is as easy as a oneliner:

Get-VMHost | Sort Name | Select Name, @{N=”NTP”;E={Get-VMHostNtpServer $_}}

3 thoughts on “Checking VMware NTP configuration with Powershell

  1. I recently needed to check settings as well as determine if the NTPD service was running.

    Get-VMHost | Select-Object Name,@{Name=”NTPServer”;Expression={$_ | Get-VMHostNtpServer}}, @{Name=”NTPRunning”;Expression={($_ | Get-VMHostService | Where-Object {$_.key -eq “ntpd”}).Running}} | Sort-Object -Property “NTPRunning”, “NTPServer”

    I used this to generate a report and added some extra script to fix incorrect settings (also works to change NTP server setting) as well as restart NTPD service if it has stopped.

    I have the full script available at:

    and on the PowerCLI VMware community.

Leave a Reply