Thursday, September 11, 2014

Query NTP Settings on ESXi 5.x Hosts

Short and sweet today. We needed to report on the NTP settings for our ESXi 5.0 hosts. We've got enough hosts to justify wrestling with PowerCLI a few minutes (okay, more like 30 minutes), as opposed to clicking through the dozens of screens necessary in the vSphere client.

Specifically, we wanted a list of the hosts, the NTP servers they were using for time sources, how the service was set to start (the Policy), and whether the service was running. Here it is:

The command will output a report with Name, NTP Server, Policy, and ServiceRunning columns for each VMHost in your vCenter. It's perfect if you're looking to verify that each host has been set identically.