VMware Cloud Community
athurston
Enthusiast
Enthusiast
Jump to solution

Update tools & Vsield drivers from a vapp

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

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

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

athurston
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos