***NOTE*** this can be tweaked to look for specific VMs or groups of VMs Get-View -View Type Virtual Machine | foreach #you can then disable this and set it back to the default value with this: $Config = New-Object VMware. This is because Invoke-VMScript uses VMtools to invoke the command in the guest. Tools Upgrade Policy = “Upgrade At Power Cycle” # run through each virtual machine. foreach ($vm in $windows) #**Note that I use the –Error Action Silently Continue parameter. This way you won’t have to place your password in a script. you can also use the –Guest Credential if you have the credentials (get-credential) stored in a variable, in place of the –Guest User and –Guest Password parameters.However, this statement is inaccurate and has caused some confusion with our customers.I would like to take this opportunity to help clarify the expected behavior as you plan for VMware Tools upgrade in v Sphere 5.1. If you are running VMware Tools prior to v Sphere 5.1, an operating system reboot will always be required for new device drivers and kernel modules to go into effect. If one or more components have been updated since the last VMware Tools upgrade or one of the VMware Tools components requests a system reboot, then a reboot will be required.and that VMware is now shipping VMware tools outside of the v Sphere releases. Since we are restarting the VMTools service, this command will come back with an error, however if you check the windows logs you’ll see the command functions properly and this error is only because the Tools connection is being reset during the command execution (this is normal when running the restart-service VMTools command) By default, ESXi includes VMware Tools under the /product Locker folder (which is actually a Symlink to the location on it’s local storage.. When running ‘ls –n’ you will see that product Locker (cyan) just points to /locker/packages/5.5.0 (dark blue meaning the path exists. ‘ls –n /product Locker’ will return only that line and be a little easier on the eyes for those who are not as familiar with unix.Since then, we have received a lot of feedback from the community, customers, and internal folks alike. Inside of the given folder are two other folders: “floppies” and “vmtools” these contain all necessary ISOs and files to allow VMware tools to be installed and updated on each supported VM on the host.
If you are running an RPM-based Linux distribution, such as Red Hat, updating VMware-Tools on your VM should be quick and easy.There have been some recent questions about upgrading to the latest version of VMware Tools in v Sphere 5.1 and the benefits it may bring with future upgrades of VMware Tools.Historically, VMware Tools upgrades has always required an operating system reboot as new device drivers and kernel modules will not go into effect until the next reboot. if all vm’s have the same admin account or an Admin AD account, use that… Tools Upgrade Policy = “manual” Get-View -View Type Virtual Machine | foreach # Get all Virtual Machines that have the “windowsguest” attribute in Extension Data. Guest Family, and that are powered on $windows = Get-View -View Type Virtual Machine | where # Foreach virtual machine from the results, run “restart-service” within the guest **Note the username and password will need to be updated.