Extensions

VM Tools and Virtual Hardware Versions

Alan Renouf, Sr Technical Marketing Architect, VMware

After reading Kyle’s post on the ESXi Chronicles blog here (I didn’t know you could do that) I wanted to show how you could gather and also export the Tools and Virtual Hardware Version in PowerCLI, this also allows us to use one of my favorite cmdlets New-VIProperty, a great post on this cmdlet can be found here.

If we look at the  object which gets returned back when we use the Get-VM cmdlet you will see that there is a root property for the Name, PowerState, NumCPU and many many more, one of these is the Version, this shows the hardware version so its easy enough to grab each VM’s name and Hardware Version by using:

Get-VM | Select Name, Version

But the returned object doesn’t have a root property for ToolsVersion or ToolsVersionStatus, for this we need to delve into the ExtensionData property and have a look around, once we have found the information it is fairly easy to add these to our object using the New-VIProperty cmdlet as below:

New-VIProperty -Name ToolsVersion -ObjectType VirtualMachine
    -ValueFromExtensionProperty 'Config.tools.ToolsVersion'

    -Force

New-VIProperty -Name ToolsVersionStatus -ObjectType VirtualMachine
    -ValueFromExtensionProperty 'Guest.ToolsVersionStatus'

    -Force

Now we have added these as a new property to our object (actually they are PowerShell Code Properties), we can use our old friend Get-VM to retrieve the information easily:

Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus

image

Of course we can choose which list of VMs to get this information for:

For a Datacenter: Get-Datacenter London | Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus

For a cluster: Get-Cluster Production | Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus

For a host: Get-VMHost Host1.mydomain.local | Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus

And we can also easily export this information into a csv file:

Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus | Export-Csv -NoTypeInformation -UseCulture -Path C:\Temp\VMHWandToolsInfo.csv

Comments

18 comments have been added so far

  1. New-VIProperty -Name ToolsVersion -ObjectType VirtualMachine -ValueFromExtensionProperty Config.tools.ToolsVersion -Force
    New-VIProperty -Name ToolsVersionStatus -ObjectType VirtualMachine -ValueFromExtensionProperty Guest.ToolsVersionStatus -Force

  2. Hello Alan,

    Thank you for taking the time to put this together, I found it to be very useful.

    Best regards,
    Brian

  3. This writing are all that she has feelings for in her Earth. Will you write scary writings! Blast! We fell on his techs among them to that a man need to deem which they are pretty.

  4. Hello Alan,

    We really need to list the VMware Tools version with the BUILD version

    We recently got a patch from VMware that is a minor upgrade for the VMware Tools, so the only to find out if the Tools were updated correctly is to check the build number of the Tools… since we have more than 700 VMs, we cannot go in each VM and execute the command in Windows that gives the version and build of the Tools : VMwareToolboxCmd.exe -v gives something like : 9.4.10.38250 (Build-2092844).

    DO you know if there is another variable that would do the trick in powercli ?

    Thank you !

  5. I’m running esxi6.0 and PowerCLI 6.3 Release 1.
    ToolsVersion and ToolsVersionStatus fields are blank, HW version is returned. Anyone else see this behavior?
    Command I used:
    get-vm -location “Some-folder-name” | Select Name, Version, ToolsVersion, ToolsVersionStatus

    1. You must use before :

      New-VIProperty -Name ToolsVersion -ObjectType VirtualMachine
      -ValueFromExtensionProperty 'Config.tools.ToolsVersion'

      -Force

      New-VIProperty -Name ToolsVersionStatus -ObjectType VirtualMachine
      -ValueFromExtensionProperty 'Guest.ToolsVersionStatus'

      -Force

  6. Canon is a leading brand in digitalization. It will provide the best printer to print your own idea with relevant features. But there are some issues were occurs while using it and it can’t resolve itself and want to some experts advice so there is Canon Printer Customer Service executive to sort your issue.

  7. Canon is a leading brand in digitalization. It will provide the best printer to print your own idea with relevant features. But there are some issues were occurs while using it and it can’t resolve itself and want to some experts advice so there is Canon Printer Customer Service executive to sort your issue.

  8. Or if enabling the property isn’t easily done for your environment, the following should work too.

    Get-Vm $computername | select name,
    @{n=”CPUs”;e={$_.numcpu}},
    memorygb,
    @{n=”VM Tools Version”;e={$_.Extensiondata.Config.tools.ToolsVersion}},
    @{n=”VM Tools Status”;e={$_.Extensiondata.Guest.ToolsVersionStatus}}

  9. Are you looking for IJ setup Scan Utility or IJ Printer Utility is an application developed by Canon for making the print / scan job easier. The IJ Scan Utility enables you to scan photos and documents to your computer operating on Windows or Mac. have any issues can connect our expert engineer can resolve your all query available 24/7 in the US.

Leave a Reply

Your email address will not be published. Required fields are marked *