martedì 3 marzo 2020

VM Hardware and Tools Status,Version

Problem
I need to check and compare for each Virtual Machine the version of the Virtual Hardware, the Status and the Version of the VMware Tools.

Solution
The easiest way I've found is to make some a simple script like the following via PowerCLI.

$Report = @()
foreach ($VM in Get-VM) {
  $vmHW=@{} 
 $temp = Get-View $VM |  Select Name, @{N="HWVersion";E={$_.Config.version}},  @{N='VMwareToosStatus';E={$_.Guest.ToolsStatus}}, @{N="VMwareToolsVersion";E={$_.Config.Tools.ToolsVersion}}
 $vmHW.VMname = $temp.Name
 $vmHW.HWVersion = $temp.HWVersion
 $vmHW.VMwareToosStatus = $temp.VMwareToosStatus
 $vmHW.VMwareToolsVersion = $temp.VMwareToolsVersion
 $tempNObject = New-Object -TypeName PSObject -Property $vmHW
    $Report += $tempNObject
} 
$Report | Select @{N="VM Name";E={$_.VMname}}, @{N="HW Version";E={$_.HWVersion}},  @{N='VMware Tools Status';E={$_.VMwareToosStatus}}, @{N="VMware Tools version";E={$_.VMwareToolsVersion}}  | Sort-Object -Unique "VM Name" | Format-Table -AutoSize 



That's it.

1 commento:

  1. "Thanks for sharing this information. JRS Pipes and Tubes offers best quality of MS Pipe at the reasonable prices. We are best MS Pipe Dealers in India.
    "

    RispondiElimina