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 …

Workspace ONE Access Multisite Tasks – One Pager

vIDM, VMware, Workspace ONE Access

For the past few weeks, I have been working with my project team and my customer to help them stand up VMware Access on a secondary site. With the help of Haseeb Waseem, I have created a single spreadsheet which includes all the major steps needed to create a secondary site. Hope this is helpful […]

Read More

Duplicate “ViewClient_Client_ID” and Multi Session issues on Horizon View

Horizon View, VMware

Multi-Session Issue on VMware Horizon View Due to Duplicate “ViewClient_Client_ID”   Problem:              When we enable the “Allow multiple sessions per user” settings in VDI Pool, a user that connect from different client devices receive different desktop sessions. To reconnect to an existing desktop session, user must use the same […]

Read More

Configure NSX-V Edge Load Balancer for Horizon

Horizon View, NSX, VMware

In this blog post I will walkthrough of how to create a load balancer VIP to balance traffic between VMware Connection servers. In the below case, I’ll configure an NSX edge to load balance traffic between my connection servers.           Step 1 : Deploy a NSX Edge In networking and Security, […]

Read More

Leave a Reply

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