NTP configuration on multiple ESXi hosts via PowerCLI

As you might know, keeping our ESXi hosts’ date and time accurate is very critical. To prevent having an inaccurate time configuration we can use the NTP server in our environment.
A few days ago, I faced a question about NTP configuration in the vSphere environment and how to set NTP configuration on many ESXi hosts. Hence, I decided to use the PowerCLI commands to configure NTP configuration most easily with an example.

Kindly find the commands have been used in my example:

Connect-VIServer vCenter_Server_Address
Get-VMHost | Add-VMHostNtpServer ntp.virtual-mir.com
Get-VMHost | Get-VMHostFirewallException | where {$_.Name -eq “NTP client”} | Set-VMHostFirewallException -Enabled:$true
Get-VMHost | Get-VmHostService | Where-Object {$_.key -eq “ntpd”} | Start-VMHostService
Get-VMhost | Get-VmHostService | Where-Object {$_.key -eq “ntpd”} | Set-VMHostService -policy “automatic”

I’m sure if you are a GUI person, switching to PowerCLI might be a hard transition but once you used to script, you will never go back to GUI, and learning new things is always fun, so let’s try out.

You might be interested in …

Configure NSX-V Edge Load Balancer for Horizon

Horizon View, NSX, VMware

In this blog post I will walkthrough of how to create a load balancer VIP to balance traffic between VMware Connection servers. In the below case, I’ll configure an NSX edge to load balance traffic between my connection servers.           Step 1 : Deploy a NSX Edge In networking and Security, […]

Read More

Enabling dynamic codec switching Horizon View 7.10

VMware

VMware Horizon 7.10 – released on September 17, 2019 – ships with a new dynamic encoder. Depending on what content you’re watching in your VDI, it will seamlessly switch to the best suiting codec for optimal performance/quality-balance. While H.264 is ideal for rapidly changing content like videos, JPG/PNG offers better quality for more static content […]

Read More

How to find VDI Client (ThinClient) MAC address from Horizon View

Horizon View, VMware

        While administering VDI environments, most of the time we will struggle to get Thin Client or VDI Client MAC address for troubleshooting, re-imaging or for providing remote shadow support. Below article explains about a simple “visual basic” script to get this information. In my case, I kept this script on network […]

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *