I want to check the box "Automating Upgrade of VMware Tools" for all windows VM created in last 7 days. Currenlt , i have following script from which i was providing manual VM name but i need to automate it only for windows VM
foreach($vmlist in (Get-Content -Path C:\TEMP\vmliste.txt))
$vm = Get-VM -Name $vmlist
# $VM = Get-VM # Filter here if needed
$VMView = $VM | Get-View
if($VMview.config.tools.toolsUpgradePolicy -ne "upgradeAtPowerCycle")
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.changeVersion = $VM.ExtensionData.Config.ChangeVersion
$spec.tools = New-Object VMware.Vim.ToolsConfigInfo
$spec.tools.ToolsUpgradePolicy = "upgradeAtPowerCycle"
$_this = Get-View -Id $VM.Id
Write-Host "Update Tools Policy on $vm completed"
Write-Host "Update Tools Policy on $vm already esxists"
Exception calling "ReconfigVM_Task" with "1" argument(s): "The method is disabled by 'horizon.daas'"
You didn't mention there were some Horizon View stations in there.
Horizon disables that method since it wants to control the stations it manages.
The best way to upgrade those is to use the Horizon functionality.
Make a new Master or a Snapshot with the correct HW version.