Below Script will get virtualmachine hardware version , tools version , Tools status , Tools version status .
Connect-VIServer -Server VM-VC.TEST.COM -User root -Password ********
Get-VM |
Select @{N=”VMName”; E={$_.Name}},
@{N=”HardwareVersion”; E={$_.Extensiondata.Config.Version}},
@{N=”ToolsVersion”; E={$_.Extensiondata.Config.Tools.ToolsVersion}},
@{N=”ToolsStatus”; E={$_.Extensiondata.Summary.Guest.ToolsStatus}},
@{N=”ToolsVersionStatus”; E={$_.Extensiondata.Summary.Guest.ToolsVersionStatus}},
@{N=”ToolsRunningStatus”; E={$_.Extensiondata.Summary.Guest.ToolsRunningStatus}}
| Export-Csv C:\vmdata.csv
Output
VMName | HardwareVersion | ToolsVersion | ToolsStatus | ToolsVersionStatus | ToolsRunningStatus |
TEST-VM-01 | vmx-11 | 10249 | toolsOld | guestToolsNeedUpgrade | guestToolsRunning |
TEST-VM-01 | vmx-11 | 2147483647 | toolsOk | guestToolsUnmanaged | guestToolsRunning |
TEST-VM-01 | vmx-11 | 10282 | toolsOk | guestToolsCurrent | guestToolsRunning |
TEST-VM-01 | vmx-11 | 10249 | toolsOld | guestToolsNeedUpgrade | guestToolsRunning |
TEST-VM-01 | vmx-08 | 2147483647 | toolsOk | guestToolsUnmanaged | guestToolsRunning |
TEST-VM-01 | vmx-11 | 10249 | toolsNotRunning | guestToolsNeedUpgrade | guestToolsNotRunning |
TEST-VM-01 | vmx-10 | 9354 | toolsOld | guestToolsNeedUpgrade | guestToolsRunning |