[Script]: Check Time Synchronization with Host on Virtual Machines – PowerCLI

As you know, virtual machines can sync their time with ESXi host when VMware Tools is installed on the virtual machines. Also the configuration should be enabled on virtual machine configuration manually. The configuration is available on “Virtual Machine Properties”:

VMware Tools - Synchronize guest with host
VMware Tools – Synchronize guest with host

If there is more than one virtual machine (Absolutely YES), the configuration should be enabled via an automation solution such as PowerCLI because enabling the configuration manually is very difficult.

As all virtual machines don’t need to this configuration for time synchronization, administrators enables the configuration for some VMs when it needed. Some times, administrators have to provide a report from the virtual machines which have the configuration enabled.

So how an administrator be able to create a query from the virtual machine.

The stupid solution is checking virtual machine via GUI one by one. But true solution is create query from virtual machine via an automation tools such as PowerCLI

The Script!

Administrator can run the below PowerCLI script to find the virtual machines with “Synchronize guest time with host” configuration:

The {File Path} should be changed with actual file path for storing the information as CSV file.

More on Tiemouri.Net

VMware Tools Client – Interact with a VM without Network Connectivity

Add existing virtual desktops to “Automated Pool” in VMware View manually

Add SATA drives to ESXi 5

Update VMware Tools Automatically

Run ESXi Commands Via PowerShell And SSH

Davoud Teimouri

Professional blogger, vExpert 2015/2016/2017/2018/2019/2020/2021/2022/2023, vExpert NSX, vExpert PRO, vExpert Security, vExpert EUC, VCA, MCITP. This blog is started with simple posts and now, it has large following readers.

Leave a Reply

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