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 …

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

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

Workspace ONE Access Log Files and Location

VMware, Workspace ONE Access

Workspace ONE Access Logs and Config File location I came across many times with my customers asking about the logs file location and config file for VMware Workspace ONE Access. Below table has most useful log file location and config file that Engineers and admin should know about and will be helpful to troubleshoot WS1 […]

Read More

Leave a Reply

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