Update VMware Tools on specific servers

Hello

I developed the following script, using various sources, I found on the internet, which I run from the virtual Center Server to update VMware tools on a number of servers:

' $insParm = "/ s v" /qn REBOOT = ReallySuppress "'

#------------------------------------------------------------------------------
# Configure the variables
#------------------------------------------------------------------------------
Host name of the server #VM
$VMServer = "06W8F5VC01".
#User account to connect to the virtual infrastructure:
$username = "root".

#Directory path to the list of targets of VM.
$updList = get-Content "C:\users\jmilano-adm\desktop\serverlist.txt".

Write-Host "Serverlist: ' $updList
write-host

#------------------------------------------------------------------------------
# Connect to the VM Server
#------------------------------------------------------------------------------
# $server = to connect-VIServer-Server $VMServer - User $username
$server = to connect-VIServer-Server $VMServer
#Search for specific VM in the production cluster:
#$folder = get-file-name "Financial Hosts' #Target financial Hosts file in the VM Infrastructure Client console
$cluster = get-Cluster-name 'MEL_Cluster_01 '.

Write-Host "cluster Var: ' $cluster

#------------------------------------------------------------------------------
# Main()
#------------------------------------------------------------------------------

foreach ($uVM to $updList)

{
$vm = get-VM-name $uVM - location $cluster

#$VM.name
write-host "
write-host "host to upgrade:" $VM.name

#$uVM.UpgradeTools_Task ($insParm)
UPDATE-TOOLS - VM $VM. Name - RunAsync - NoReboot

write-host "
write-host "host has been improved.

#Wait 30 seconds before you start another task update
Start-sleep - s 30
}

I tested the script and it works very well, but what I want to do is change it so that it performs the following:

* Check this box when the line read from the ServerList.txt file is empty. If Yes, read the next line.

* Check the virtual server to verify that the VMware Tools is indeed obsolete. If so, update.

* Check if the server has no VMware tools. If it is not the case, install the latest version.

To create a log file on the server on which the script is run.

* Check if the installation was successful in fact. Add this information to the log file.

Pls know me what changes I need to run the script to reflect the foregoing. Thank you

Thinking about your questions. Here it is:


#* Checks the virtual server to verify that the VMware Tools is indeed out of date. If so, update it. 

 foreach($vmItem in $vm) {
  if($vmItem.extensiondata.guest.toolsStatus -ne "toolsOK"){
   #Possibilities:
   # - toolsOk
   # - toolsOld
   # - toolsNotRunning
   # - toolsNotInstalled

   write-host "Vmware Tools is Not ok, upgrading...";
   UPDATE-TOOLS -VM $vmItem.Name -RunAsync -NoReboot

  }else{
   write-host "Vmware Tools Ok, no need to upgrade";
  }

 }
#* Check if the server does not have VMware Tools. If it does not, install the latest version.
 I think the earlier script will work fine to this condition. Please tell, if not.

#* Create a log file on the server which the script is being run.
 You can use the Measure-object cmdlet to see how long it took to run the script.

#* Verifies if the installation actually succeeded. Add this information to the log file.
 After the Measuring, you can query again the Vmware Tools Status or create a looping to try more times till Vmware tools is readed as OK

Tags: VMware

Similar Questions

  • Updated Vmware-Tools

    Hello

    I want to update vmware-tools on specific host esx with a scheduled task.

    I used this command:

    vimsh - EI vmsvc/tools.upgrade 32 n

    But I get this error:

    # vimsh e vmsvc/tools.upgrade 32 n

    File not found.

    Current working directory: / usr/lib/vmware/hostd

    HOSTINFO: See Intel CPU, numCoresPerCPU 4, numThreadsPerCore 1.

    HOSTINFO: hyperthreading disabled, set the number of threads by heart at 1.

    HOSTINFO: This machine has 2 physical processors and 8 cores total 8 logical processors.

    Libcrypto.so.0.9.7 system library is older than our library (90701F & lt; 90709F)

    Vmacore::InitSSL: doVersionCheck = true, handshakeTimeoutUs = 120000000

    Unknown path: /vmomi/

    Insufficient arguments.

    Use: tools.upgrade vmid

    Upgrade VMware Tools in the virtual machine

    It seems that the cmd needs more arguments, but I cannot find anywhere that I should or Arguments that you can use for this cmd.

    doooooh! reading too fast! You are right!!!

    I tried right now option. Inside vimsh, no problem, it works ok and gives what is supposed to output.

    I have run the command from the shell I non-interactive mode and gives the same error!

    I'll give it a glance, because it is not the first parameter that I can't change vimsh...

    AlexNG

  • Update VMware tools and hardware of txt file

    need to update the vmware tools more material on a cluster of virtual machines to txt file

    So I have

    Get-contexte.\vms.txt | % {update-tools $_ - Runasync}

    Then I'll check before virtual machines in virtual machine material

    Get-content.\vms.txt | % {get - vm $_} | Select ' Name,@{N='ToolStatus; E={$_. {{ExtensionData.Guest.ToolsStatus}}


    If they are ok,


    Then I'll make the material

    get-content.\vms.txt | % {set - vm -vm $_-version V9-confirm: $false}



    is there a better way to put it together in a script?


    It is ok, but not fully automated.

    So that the process is fully automated, you could do something like this

    $vms = get-Content.\vms.txt

    # Update VMware tools

    $taskTab = @ {}

    Update-tools - VM $vms - RunAsync | %{

    $taskTab.Add ($_.) ID, $null)

    }

    # Wait until all tasks are completed

    While ($taskTab.Count - not 0) {}

    $keys = $taskTab.GetEnumerator () | %{

    $status = get-task-Id $_. Key

    if($Status.) State - only ' works') {}

    $_. Key

    }

    }

    $keys | %{

    $taskTab.Remove($_)

    }

    sleep 5

    }

    # Update HW

    Set-VM - vm $vms - V9-confirm Version: $false

  • Install / / update VMWare Tools without physical disk drive

    Hello

    just installed VMWare Player, then Linux Mint 17 on my desktop pc and my laptop. Worked perfectly on my desktop pc, while on the laptop when I click on install vmware tools, nothing would happen. I guess this is because the laptop is not a physical drive so I can only add a CD/DVD drive with the .iso option and then VM Player cannot load the iso required for installing the tools. Anyway, I left my office laptop the source tarball and has installed but for some reason, the vmware interface settings player says I have to update my tools in order to use 3D acceleration. Once again... I can't install the update in the usual way for so I click on install, nothing happens.

    Any ideas?

    Was able to install successfully by using this

    VMware Tools missing in the Installation of VMware Player 7

  • To update VMware Tools PowerCLI

    Hallo,

    I need help creating a script PowerCLI to generate a report in the csv file for all the VMS in vCenter with Out of Date VMware Tools

    Thank you

    Joseph

    Hi Joseph,.

    I think my script in Re: Script to find all the VMS with dates/non installed tools will do the job.

    Best regards, Robert

    Post edited by: RvdNieuwendijk corrected the link to the optimal solution.

  • Update VMware tools - shows "does not work".

    I'm having a problem where vmware tools say that they are not running.

    Background:

    Upgrading to esx 4.0 to esx 4.1

    VM = Server 2008 R2 core - console open after clicking on upgrade vmtools/interactive

    past to the drive (d :) to cdrom and ran the setup64.exe

    all is well and restarted

    and now under vmware tools just says he does not

    I can ping the server and it seems that the tools are running as I can the mouse in the console window without having to leave the cursor etc..

    However it is said that they are not running and the vmware tools service does not, either. The error of the service gives when I try and start it is:

    "Error 2: the system cannot find the file specified. '.

    All other services seem to work fine on the server.

    Any ideas?

    Thank you

    Have you tried to remove the tools and reinstall?

    If you have found this device or any other useful post please consider the use of buttons useful/correct to award points

    Twitter: http://twitter.com/mittim12

  • Update vmware tools list .csv

    Hey guys,.

    It seems that it will work?

    # Connect to vCenter #.

    SE connect-VIServer-Server "vcenter.

    # Error handling.

    $ErrorActionPreference = "continue".

    # Source VMS to be upgraded

    $v = get-Content "C:\vms.csv".

    # Upgrades all the virtual machines in vms.csv #.

    foreach ($v in $v) {}

    Get-cluster-name 'cluster1 | Get - VM $v | Where-Object {$_.} PowerState - eq "Receptor"} | Update-tools - NoReboot}

    # Se disconnects the vcenter #.

    disconnect-viserver-confirm: $false

    Thanks for the help, as always!

    -eric

    Depends on what the content of your CSV file looks like.

    It is for example something like

    "VMName".

    "VM1.

    "VM2.

    You must use the following line (use the column name in the property)

    Get-Cluster-name 'cluster1 | Get - VM $v.VMName | Where-Object {$_.} PowerState - eq "Receptor"} | Update-tools - NoReboot}

    For the rest, the script seems well.

    You could possibly add the RunAsync switch to the cmdlet Update-tools , the update will run in the background.

  • Update the vmWare tools in VoP via vCenter

    I'm still new to this community and I hope I'll catch up here soon, but I'm not sure of the update process the vmtools on the device of VoP. I know once I spunt'sand he upwards and configured the IP etc, the vCenter as the tools were obsolete. Tonight is our night of patch management and we'd get VoP abreast, as far as tools go. What is the process to get this done? Do I just shoot vCenter or are there steps to perform on the server of VoP so.

    Thank you in advance for your help!

    Hi David,

    You can update VMWare Tools on the device in the same way as you would for any virtual machine of OpenSUSE Linux.  This can be done manually from the console if vCenter may not withdraw that, alone.

    I hope this helps!

  • Updated VMware vCenter Operations Manager tools

    Hello everyone, I just use Citrix Xenserver to VMware vCenter with Operations Manager 5.8.4.  I've looked everywhere and cannot find an answer to this.  Is it possible to update VMware tools in the vCOPS TIME?  I just started my new environment with v8 of Veeam backup and he lets know me that VMware tools are outdated.  The only reason why I ask because, coming from Citrix Xenserver v6.2, whenever a device from the virtual computer is provided by Citrix, you're stuck with the tools provided in this unit until they update the device.

    If it's good to update the VMware tools, it's as simple as opening the console to each virtual machine in the vApp and he tell the ' Install/Upgrade Vmware Tools?  Or is there a more complicated step?

    Thank you

    Brett

    As far as I KNOW, the VMware tools upgrade is not recommended on vCops.

    This breaks the device and you can ignore the message of the VMware tools obsolete.

  • Update the VMware Tools?

    Last night, I ran the following command powercli hoping to update VMware tools on some of my virtual machines without having to restart the virtual machine.  The script seems to work very well as the tools to update properly, but unfortunately all the VM was restarted as soon as the update is complete.

    Can someone check my code and tell me what I am wrong?

    Get-Content "c:\scripts\txt_files\VMs.txt" | ForEach-Object {Get-VM-name $_ |} Update-tools - NoReboot - RunAsync}

    Thank you

    Jason

    Hi jason,

    the script is good. Using the update tool - NoReboot parameter is said:

    Indicates that you do not want to restart the system after the update of the VMware Tools. This parameter is supported only for the Windows operating systems. NoReboot shall provide all of the following options for the Setup program of the VMware Tools on the guest OS:

    /s /v "/qn REBOOT = ReallySuppress"

    However, the virtual machine may still restart after the update of VMware Tools, according to the currently installed version of VMware Tools and the version of VMware Tools that you want to upgrade vCenter Center/ESX versions.

    Looks like you had a version of VMware Tools requiring a reboot.

  • Update the VMware tools cluster HA/FT

    We have a cluster running multiple 5.1 ESXi hosts and a 5.0 ESXi host. The virtual machine running on 5.1 guests show their tools VMWare is obsolete, but the virtual machine running on the 5.0 show their tools as being COMMON since with each new version of ESX, VMWare tools must also be updated. My question is: If we update VMware tools on virtual machines on 5.1, guests will be able to run on the host 5.0 if necessary? Therefore, an active cluster HA/IP hosts automatically migrated to guests according to load, etc.

    Any help is appreciated. Thank you.

    You can use the "product VMware interoperability matrices" to check compatibility. See the attached screenshot where you can see that running the ESXi 5.1 on ESXi hosts tools 5.0 is supported. You can find "the VMware product interoperability matrices" at: http://partnerweb.vmware.com/comp_guide2/sim/interop_matrix.php

  • Is there any update for VMware Tools for Workstation 8.0.3?

    I've never installed a new version of VMware Workstation without the need to upgrade VMware tools in each of my virtual machines.  After the upgrade to Workstation 8.0.3 there was no prompt to update VMware Tools and he says that it is up-to-date.  Was there no new version of VMware Tools with this upgrade, or am I missing something simple just?

    Thank you

    ~ J

    What I see on VMware Server, VMware Tools 8.8.2 are used in both VMware Workstation 8.0.2 and 8.0.3.  So, looks like two issues CVE VMware Workstation 8.0.3 addresses has been fixed in the base files not tools packages.

  • How update the vmware tools on the guest or virtualcenter

    Hello

    We run a store where we support some linux boxes.  We had some problems with time drift and other things and on our vmware guy suggested put us the version of VMWare tools on the guest or virtual Center.  The only problem is that I can't find a procedure for this.

    To clarify, I'm not how to install VMWare tools on virtual machines.  We know how to do and we know to recompile after we patch the kernel.  But our guys VMWare suggests that in the end we're just recompile the same old version of VMWare tools to make it work with the new kernel.

    In fact, we suspect the version we have is very old, that we have not successfully updated because we were running on 2.5 and are now running on 4.0 Update 1 (wait for the 4.1 support nexus is added).

    Thank you

    Dan

    Welcome to the forums!

    So I assume you mean updating the source VMware Tools, which is then used to update VMware tools in guests?

    The guy from VMware is true, recompile the tools is necessary after a kernel update has been done. It is not up-to-date version. However, you must do that to make them work again.

    The latest VMware tools comes with the latest product or updates/patches for this product. Information shows that the tools are not updated after you apply this hotfix or an update.

    They also can be downloaded here (for ESX 4.x) : http://www.vmware.com/patch/s3portal.portal?_nfpb=true&_windowLabel=SearchPatch&SearchPatch_actionOverride=%2Fportlets%2Fpatchupdate%2FdisplayAllBundlePatches&_pageLabel=s3portal_pages_downloadPatch_page

    AWo

    VCP 3 & 4

    \[:o]===\[o:]

    = You want to have this ad as a ringtone on your mobile phone? =

    = Send 'Assignment' to 911 for only $999999,99! =

  • Error updating Windows VMWare Tools

    Just upgraded to 7.0.1, and when I try to update VMWare tools, it turns off and download tools, wonder my root password (normal), then fails, the error

    "Error: failed to install the VMware tools for Windows 2000 or later." Please report it to VMware or your administrator system as appropriate. »

    I was not able to find the logs with anything either. If someone can point me in the right direction...

    And this may be due to:

    http://communities.vmware.com/thread/196350

    and

    http://communities.VMware.com/message/1467500

    I tried today and it seems to be fixed

  • Need for security upgrade VMware Tools?

    Hello, Im using a VMware environment that runs a good handful of Linux VM.  We're running 5.1 VMware update 3 on all hosts.

    Im not a Linux guy and im going to have to start learning more about Linux, but I've noticed to allocate to the virtual machine is here who have Linux, either do not have VMware tools installed, or are obsolete.  Its mix of Red Hat Enterprise 6, SUSE Linux 11, CentOS 4/5/6/7 and Ubuntu.

    My first concern is security, from a point of view security should I get these Linux VM up to date with the latest VMware tools, or else get installed on it?

    A feature point of view im says that the virtual machine is working well.

    Thank you

    Mike

    Hi Defrogger,

    I have a small number of Linux virtual machines in my environment and I have VMware tools installed, its always good to keep up to date.

    They also provide the required drivers for the VM Client interact with the reliable ESXi host. This interface allows also ESXi host be able to check on the health of the client VM during its operation.

    Here's a link below to help you install vmware tools on linux servers

    VMware Tools for Linux clients

    Rob

Maybe you are looking for

  • How can I import/move/copy my favorites from 2.0.14 to 9.0.1 Firefox Seamonkey?

    I use Seamonkey for years and am now moving to Firefox/Thunderbird. I have several bookmarks in SM 2.0.14 for two different users.

  • Phone Skype on Windows 10

    Until a few days ago my Skype worked on 650 Lumia. Once the updates have been installed, I am not able to use Skype. There is no icon, it says it is installed. Then he said: there is an update, but then only update it stops with error 0 x 80070057. C

  • HP dv7 is: has received recovery disks

    small question.  Just got the HP recovery discs.  What I need to know.  Can I start with systems recovery disc first b4 I use the driver and application recovery cd.  Had to replace the hard drive.

  • XP Home Edition won't start

    I have the installation disc and no matter what I try, or the installed version of XP or the Setup disk won't let me access the desktop computer. I always get a stop error where everything crashes and tells me that "the C:\Windows\system32\pinigalo.d

  • Bing toolbar bug?

    Some days when I upgraded to IE9 RC of IE9 Beta, I've lost the Bing toolbar. I followed all the various help topics to get back but he don't show that it was reported as being enabled in tools - manage add ons. He did not appear in the list toolbar o