VMware Cloud Community
cpaterik
VMware Employee
VMware Employee
Jump to solution

Enabling NTP via PowerCLI

Using PowerCLI, I know how the add/remove NTP servers to/from an ESX server.  I know how to start/stop services on an ESX server.  How do you enable/disable NTP?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Is this what you are looking for ?

Get-VMHost MyEsx | Get-VMHostService | where {$_.Key -eq "ntpd"} |Set-VMHostService -Policy "off"

and

Get-VMHost MyEsx | Get-VMHostService | where {$_.Key -eq "ntpd"} |Set-VMHostService -Policy "on"


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Is this what you are looking for ?

Get-VMHost MyEsx | Get-VMHostService | where {$_.Key -eq "ntpd"} |Set-VMHostService -Policy "off"

and

Get-VMHost MyEsx | Get-VMHostService | where {$_.Key -eq "ntpd"} |Set-VMHostService -Policy "on"


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
cpaterik
VMware Employee
VMware Employee
Jump to solution

This may have answered my question.  Does this open up the UDP 123 firewall port?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

No, but this does

Get-VMHost MyEsx | Get-VMHostFirewallException | where {$_.Name -eq "NTP client"} | Set-VMHostFirewallException -Enabled:$true


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
cpaterik
VMware Employee
VMware Employee
Jump to solution

Thanks.

0 Kudos