Hi folks,
In my vSphere Cluster (Version 5.1) I have about 70 VMs in a resource pool called "RP_nonProd".
Now I need to enable "Sync guest time with host" on all those VM in the mentioned resource pool.
I have figured out, that with the following command:
Get-ResourcePool | Where {$_.Name -ne “Resources“ }| Select Name, @{N=“NumVM“;E={($_ | Get-VM).Count}} | Sort Name
I am able to get a coma separated list of all VMs in the resource pool. Unfortunately, I don't know which command allows me edit "Sync guest time with host" over PowerCLI.
I know, that there's an object called "$spec.tools.syncTimeWithHost = $true" which you can set to true, but I don't know, how to write a simple script with this function.
So any help will be gratefully accepted.
Regards'
Marc
Try something like this
$VMS = Get-VM -Location (Get-ResourcePool YourResourcePool) $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.Tools = New-Object VMware.Vim.ToolsConfigInfo
$spec.Tools.syncTimeWithHost = $true
$VMS | %{ $_.ExtensionData.ReconfigVM($spec) }
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
$VMS = Get-VM -Location (Get-ResourcePool YourResourcePool) $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.Tools = New-Object VMware.Vim.ToolsConfigInfo
$spec.Tools.syncTimeWithHost = $true
$VMS | %{ $_.ExtensionData.ReconfigVM($spec) }
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD
Thank you for helping me out with this... It worked like a charm...
Have a nice day.
Regards'
Marc