Linux fundamentalist, Virtualization beadsman, and Storage agnostic

VMware Tools Upgrade with no reboot on vSphere 4upd1

Posted by sysxperts on March 27, 2010

Using vSphere 4 upd 1 with PowerCLI of same version to upgrade tools without a reboot of the guest.

I wanted a script that would help me update the VMware Tools on WIndows guests without requiring a reboot but only found a script that worked for v3.5 along with some tips to modify it to work for vSphere ESX 4 upd 1.

Therefore, I modified script found at to suit my needs.

I connected to my vCenter with Connect-VIServer command in PowerCLI and ran the file containing the text from the blockquote below with:

[vSphere PowerCLI] C:\Users\pvalentino\psscripts> ./WinToolsUpd.ps1

$starttime = get-date

#requires -version 2

$OldTools = Get-View -ViewType “VirtualMachine” `

-Property Guest,name `

-filter @{





Foreach ($VM in $OldTools) {

Get-VM `

| Get-View | Where-Object { ($_.Guest.GuestFamily -eq “windowsGuest”) `

-and ( $_.Guest.GuestState -eq “running” ) `

-and ( $_.Guest.ToolsStatus -eq “ToolsOld” ) } `

|  Get-VIObjectByVIView `

|  Update-Tools -NoReboot


$processed = $oldTools.count – (Get-View -ViewType “VirtualMachine” `

-Property Guest,name `

-filter @{





$ts = New-TimeSpan -Start $starttime

write-host (“{0} out of {1} vm’s were updated in {2}.{3} Min” -f $processed, $oldTools.count, $ts.Minutes,$ts.Seconds)

I ran this against Test/Dev with no issues but someone made a good point that I should run whyreboot in a guest to see what is returned 🙂 ,thanks @tscalzott…

So I went to the lab and ran the script against a few more Windows guests including 2003 and 2008 servers then ran the whyreboot command and obtained the same result on all:



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: