VMware Cloud Community
system_noida
Enthusiast
Enthusiast
Jump to solution

Upgrade VMware tool from a remote sharepath \\servername\Vmtool\setup64.exe

Hi All,

 

I need help. I am looking a script to upgrade the vmware tools on multiple servers remotely without server reboot, using the setup64.exe located on a share path, like \\Servername\Vmtool\Setup64.exe /s /v "/qn REBOOT=R ADDLOCAL=ALL"

Please can someone help me with this.

Many Thank,

Jitendra K

Labels (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Since you state "upgrade" that means the VMware Tools are installed, so you could use the Invoke-VMScript cmdlet to run that setup64.exe command inside the Guest OS.

Invoke-VMScript -VM <VMname> -ScriptText '\\servername\Vmtool\setup64.exe /s /v "/qn reboot=r"' -ScriptType Powershell -GuestUser <username> -GuestPassword <password>


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

Since you state "upgrade" that means the VMware Tools are installed, so you could use the Invoke-VMScript cmdlet to run that setup64.exe command inside the Guest OS.

Invoke-VMScript -VM <VMname> -ScriptText '\\servername\Vmtool\setup64.exe /s /v "/qn reboot=r"' -ScriptType Powershell -GuestUser <username> -GuestPassword <password>


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
system_noida
Enthusiast
Enthusiast
Jump to solution

HI @LucD , Its working , but works for few . I added 5 server to do testing , its upgraded tools on 3 only , other 2 are not upgraded . not sure what is the issue. the other 2 are working fine from OS perspective and are up.

 

Moreover how can I input a file which has all the server name and which code I can sue to run this script against all server specified in the input file.

 

Thanks

Jitendra K

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

To analyse why it will not upgrade on some stations you will have to look at some logging.
That could be the Guest OS native logging or as described in VMware Tools Installer Logging to Host

You can place all the server names in a CSV file, and then use a Foreach-Object cmdlet

# CSV with column Name

Import-Csv -Path .\names.csv |
Foreach-Object -Process {
   Invoke-VMScript -VM $_.Name -ScriptText ....
}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
system_noida
Enthusiast
Enthusiast
Jump to solution

Hi @LucD , Thanks a lot for your help . you are a star.
I did checked the affected one, its pending for reboot hence VM tool not upgraded.

moreover what if on any machine the VM tool service is not running due to some reason and in that case the invoke-vmscript will not work , so what will be the alternate and which code we can use. lets say that its a new VM without vmware tool.

 

Thanks

Jitendra Kumar

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Then you will have to use another "remote" method to run the command.
If the Guest OS is Windows and you have Remote PowerShell enabled, you could use Remote PowerShell to run the command.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

system_noida
Enthusiast
Enthusiast
Jump to solution

@LucD I tried to use this code to upgrade the vmtool without invoke-vmscript, but its not working, something is wrong here. Please could you advise what correction needed or if I need to use a diff code then this.

Invoke-Command -ComputerName ServerName -ScriptBlock {Start-Process C:\VMTools-13\setup64.exe -ArgumentList /s /v "/qn REBOOT=R ADDLOCAL=ALL"}

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

"... its not working" is rather vague to allow for problem solving I'm afraid.

You could try something like in Solved: PowerShell remoting to install VMWare tools - VMware Technology Network VMTN
But again PowerShell Remoting has to be set up correctly.
Setting up PowerShell Remoting is a bit beyond the scope of this community I think.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos