如何在Vcenter上检查NTP设置

时间:2018-06-19 17:37:21

标签: powershell vmware powershell-v4.0 powercli vcenter

我要检查Vcenter上的NTP设置是否设置为“正在运行” 我正在使用以下cmdlet,但它会返回NTP服务器的IP地址。

Get-VMHostNtpServer -VMHost abc.com

如何将状态检查设置为“正在运行”?

1 个答案:

答案 0 :(得分:1)

Get-VMHostService cmdlet返回HostService实例,其中包含Running属性。

older Get-VMHostService documentation中的此示例显示了使用ntpd属性返回的服务(包括Running)的列表:

C:\PS>Get-VMHostService -Refresh

Key Label Policy Running Required
--- ----- ------ ------- --------
ntpd NTP Daemon automatic False False
sshd SSH Server automatic True False
vmware-vpxa VMware VirtualCenter Agent automatic True False