It appears that having the correct NTP (Network Time Protocol) settings in VMware ESXi is easily forgettable and prone to not having the actual service running and typo’s in NTP values.
I came across an instance just last week that had several hosts pointing to time.microsoft.com instead of time.windows.com for the NTP server values. I didn’t know it, but after I check I did. time.microsoft.com doesn’t resolve whereas time.windows.com does. This them caused me to go look at all my other hosts. Doing that manually would be a pain, so I found this script to help us bulk check all our hosts NTP server values.
Copy/Paste for usage:
Get-VMHost |Select Name, @{N=“NTPServer“;E={$_ |Get-VMHostNtpServer}}, @{N=“Service is Running?“;E={(Get-VmHostService -VMHost $_ |Where-Object {$_.key-eq “ntpd“}).Running}}
I personally keep my ESXi hosts pointed internally in production, but for this lab I like to use both internal and external.
I hope you found this post helpful.
Thanks posting your PowerCLI command, it was a time-saver! Just a tip to the masses: before running, you must first connect to your vCenter server.
Connect-VIServer -Server vcenter01.yourdomain.com