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 …

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

Install App Volumes Manager 2.15

AppVolumes, VMware

In this post, I will show you the installation steps of the App Volumes Manager. The installation will be straight forward. These installation steps can be used when installing your first App Volumes Manager but also when you install a second App Volumes Manager in your deployment. At the database connection step, I will explain […]

Read More

Horizon 7.x – Branding and customization of login page

Horizon View, VMware

As Horizon 7.7 just released last week, one of the features my customer often asked me about customizing horizon view default screen for enterprise logo and background.  I think it is a nice visual to add some simple branding to the default Horizon landing and portal pages and it is relatively straightforward to accomplish. Let’s […]

Read More

Leave a Reply

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