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

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

Unified Access Gateway with Microsoft Azure AD Integration using SAML

Many customers are moving towards extending their Datacenter workloads to the clouds, and Microsoft Azure is one of the partners that the VMware EUC team works very closely with. VMWare Unified Access Gateway, what we called “UAG,” is available in the Azure AD app gallery directly, reducing and simplifying the efforts of integration and configurations.  […]

Read More

Leave a Reply

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