Hi All,
I am trying to extract a VMware Tools status report using PowerShell, the script below does solve my purpose but I am the output is blank for ESX details. Am I missing something?
Connect-VIServer xxxxx
$esx = Get-VMHost
Get-VM | Get-View | `
Select @{N="VMName"; E={$_.Name}},
@{N="HardwareVersion"; E={$_.Config.Version}},
@{N="ToolsVersion"; E={$_.Config.Tools.ToolsVersion}},
@{N="ToolsStatus"; E={$_.Summary.Guest.ToolsStatus}},
@{N="ToolsVersionStatus"; E={$_.Summary.Guest.ToolsVersionStatus}},
@{N="ToolsRunningStatus"; E={$_.Summary.Guest.ToolsRunningStatus}},
@{N="Cluster"; E={$_ | Get-Cluster}},
@{N="ESX Host"; E={$esx.Name}},
@{N="ESX Version"; E={$esx.Version}},
@{N="ESX Build"; E={$esx.Build}} | `
Export-Csv "P:\Desktop\Tools.csv" -NoTypeInformation
Disconnect-VIServer xxxxx -Confirm:$false
Unable to retreive the stats for Cluster and ESX host corresponding to the Virtual Machine.
Can someone please help?
Thanks,
Mohammed