Tag Archives: ntp

Grabbing NTP server list from VMHosts in Vcenter

Due to some changes to our NTP server, I needed to review all the ESX hosts the region. This page nicely summarises all the cmdlet we can and should use:

Here is the one-liner which I used to grab NTP values off ESX servers (note: below is for readability, they should be in a single line). This will output a tab delimited file with ESX host name and a comma-delimited NTP server list.

$vc = “vcenter-01” ;

connect-viserver $vc -user VC_admin –password ##### ;

get-vmhost | % {$ + “`t” + ((get-vmhostntpserver $ -join “,”)

| out-file “c:\temp\$vc-ntp.txt” -append} ;

disconnect-viserver $vc -confirm:$false

Leave a comment

Posted by on April 5, 2013 in powershell, Scripts, vmware


Tags: , ,