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 $_}}

»crosslinked«

Related posts:

  1. Remove vmware memory limits with Powershell
  2. Calculate vSphere 5 Licenses with Powershell (UPDATED)

  3 Responses to “Checking VMware NTP configuration with Powershell”

  1. If only there was a Set-VMHostNtpServer….
    Keep up the goods!

  2. Whoops add-VMHostNtpServer is there to the rescue!
    :)

  3. 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:
    http://day2dayadmin.blogspot.com/2009/10/ntp-powershell-its-about-time.html

    and on the PowerCLI VMware community.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

   
© 2012 PeetersOnline Suffusion theme by Sayontan Sinha