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 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 check the compliance of VMware new Licensing for an enterprise

VMware

  As you might already know VMware announced a change to its per-CPU licensing model,effective April 2, 2020.   Do you want to check if you are compliant or need more licenses? Just see below VMwareKB which contains a PowerCLI script for checking this. VMware KB

Read More

Deployment of VMware Unified Access Gateway (UAG) on AWS as EC2 instance

Horizon View, VMware

Deployment of VMware Unified Access Gateway (UAG) on AWS as EC2 instance In this post, I’ll provide guidance on how to Deploy VMware Unified Access Gateway in AWS Amazon Native VPC as EC2 instance.  Before we proceed, currently UAG FIPS is only supported on the vSphere environment to all other deployment such as AWS and […]

Read More

Leave a Reply

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