PowerCLI: Set VM Tools Time Sync

PowerCLI: Set VM Tools Time Sync

Please see below for the snippet to enable VM time sync with host time via VMware Tools using PowerCLI

$vm = Get-VM -Name "TEST-VM-01"
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.changeVersion = $vm.ExtensionData.Config.ChangeVersion
$spec.tools = New-Object VMware.Vim.ToolsConfigInfo
$spec.tools.syncTimeWithHost = $true
$_this = Get-View -Id $vm.Id
$_this.ReconfigVM_Task($spec)
Advertisements