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 …

Horizon PowerCLI: Modify existing Pool Settings in Horizon View

VMware

Earlier this year, I inherited several Horizon View environments that were not built with manageability in mind. I am working on a larger project to conduct a proper plan and design and rebuild these environments, but until that is complete I need to continue to support the legacy installations. In these environments (Horizon 7.5.1), each […]

Read More

Configure App Volumes Manager

AppVolumes, VMware

In my previous post we installed the App Volumes Manager. Now it is time for it’s configuration. In this post I will show you the basic configuration to start of with App Volumes. Before we start make sure you have a Service Account ready for App Volumes. During the configuration, you will need this account to […]

Read More

How to Change Workspace ONE Access SAML Signing Certificate

VMware, Workspace ONE Access

In my previous engagement, a customer asked to change the Workspace ONE Access SAML signing cert after a year and a half in production.  WS1 Access was fully deployed along with DR sites and configured as 3rd party IDP with ADFS for O365 use cases. Background: SAML signing certificates ensure that messages are coming from […]

Read More

Leave a Reply

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