Pages

11/07/2013

Simple Host Time Information

Simple Host Time Information

Get-VMHost | Sort Name | Select Name, `
  @{N="NTPServer";E={$_ |Get-VMHostNtpServer}}, `Timezone, `
  @{N="CurrentTime";E={(Get-View $_.ExtensionData.ConfigManager.DateTimeSystem) | Foreach {$_.QueryDateTime().ToLocalTime()}}}, `
  @{N="ServiceRunning";E={(Get-VmHostService -VMHost $_ |Where-Object {$_.key-eq "ntpd"}).Running}} `
 | Format-Table -AutoSize

No comments: