Hi all,
I need to update the vmware tools on a group of virtual machines within a vapp to include the vshield drivers. with the following switches
/v "/qn REBOOT=R ADDLOCAL=VMCI,VShield REMOVE=Hgfs"
how would i go about scripting this so that is applied to each virtual machine in the vapp?
I've tried this below but get an error so would appreciate some guidance.
Thanks
Alex
Connect-VIServer ****
Get-VM -Location (Get-vapp Development) | Update-Tools "/qn REBOOT=R ADDLOCAL=VMCI,VShield REMOVE=Hgfs" -NoReboot -RunAsync
You can call that method in a loop for each of the VM in the vApp.
Something like this for example
Get-VM -Location (Get-vapp Development) | %{
Mount-Tools -VM $_
$DriveLetter = Get-WmiObject Win32_CDROMDrive -ComputerName $_.Name |
Where-Object {$_.VolumeName -match "VMware Tools"} | Select-Object -ExpandProperty Drive
$ScriptText = "$DriveLetter\setup64.exe /S /v `"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs,WYSE`""
Invoke-VMScript -VM $_ -ScriptText $ScriptText -ScriptType bat
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Have a look at Method 3 in Add Vmtools vShield Drivers for Endpoint Protection on ESX VM
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
hi LucD
Thats fine for a single vm but i need to apply to a group of servers hence the reason for the script as i can do it manually on a single vm.
Thanks
Alex
You can call that method in a loop for each of the VM in the vApp.
Something like this for example
Get-VM -Location (Get-vapp Development) | %{
Mount-Tools -VM $_
$DriveLetter = Get-WmiObject Win32_CDROMDrive -ComputerName $_.Name |
Where-Object {$_.VolumeName -match "VMware Tools"} | Select-Object -ExpandProperty Drive
$ScriptText = "$DriveLetter\setup64.exe /S /v `"/qn REBOOT=R ADDLOCAL=ALL REMOVE=Hgfs,WYSE`""
Invoke-VMScript -VM $_ -ScriptText $ScriptText -ScriptType bat
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
