Hello,
I need some help to know how to script/PowerCLI the Advanced option in Edit Settings for VMs to "Check and upgrade Tools during power cycling" on multiple VMs.
With that being said, can you run the command against a subset of VMs like ones in a particular cluster, or ones in a VM folder under VMs and Templates view?
Have a look at Re: Need script to enable "Check and upgradetools during power cycling" on all VMs
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The link that LucD provided shows the way to do it. Here's a function that I have added to scripts to do it. You can just loop through a list of VM names and pass them into the function.
Function Enable-VMtoolsUpgrade($vm){
Write-Host "Configuring VMTools upgrade setting"
$vmview = Get-vm $vm | Get-View
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.tools = New-Object VMware.Vim.ToolsConfigInfo
$vmConfigSpec.Tools.ToolsUpgradePolicy = "UpgradeAtPowerCycle"
$vmConfigSpec.Tools.syncTimeWithHost = $true
$vmview.ReconfigVM_task($vmConfigSpec) | Out-Null
}