I would like to see the ESX host name in the first column.
Is there a better way to do this?
Any help is much appreciated. Thanks,
The section of my script for hardware looks like this:
#######################
# VMware ESX hardware #
#######################
Get-VMHost | Get-View | ForEach-Object { $_.Summary.Hardware } | Select-object Name, Vendor, Model, MemorySize, CpuModel, CpuMhz, NumCpuPkgs, NumCpuCores, NumCpuThreads, NumNics, NumHBAs | ConvertTo-Html -title "VMware ESX server Hardware configuration" -body "<H2>VMware ESX server Hardware configuration.</H2>" | Out-File -Append $filelocation
And My Out put currently looks like this:
(I want to see the ESX Host server name as the first column)
Vendor | Model | MemorySize | CpuModel | CpuMhz | NumCpuPkgs | NumCpuCores | NumCpuThreads | NumNics | NumHBAs |
---|---|---|---|---|---|---|---|---|---|
HP | ProLiant DL360 G7 | 34348974080 | Intel(R) Xeon(R) CPU E5640 @ 2.67GHz | 2666 | 2 | 8 | 16 | 4 | 3 |
HP | ProLiant DL360 G7 | 34348974080 | Intel(R) Xeon(R) CPU E5640 @ 2.67GHz | 2666 | 2 | 8 | 16 | 4 | 3 |
HP | ProLiant BL460c G6 | 25758969856 | Intel(R) Xeon(R) CPU E5540 @ 2.53GHz | 2533 | 1 | 4 | 8 | 8 | 3 |
HP | ProLiant BL460c G6 | 25758969856 | Intel(R) Xeon(R) CPU X5570 @ 2.93GHz | 2933 | 1 | 4 | 8 | 8 | 3 |
HP | ProLiant BL490c G7 | 137428156416 | Intel(R) Xeon(R) CPU X5675 @ 3.07GHz | 3066 | 2 | 12 | 24 | 4 | 2 |
HP | ProLiant BL490c G7 | 137428156416 | Intel(R) Xeon(R) CPU X5675 @ 3.07GHz | 3066 | 2 | 12 | 24 | 4 | 2 |
HP | ProLiant BL490c G7 | 137428156416 | Intel(R) Xeon(R) CPU X5675 @ 3.07GHz | 3066 | 2 | 12 | 24 | 4 | 2 |
Not the most elegant solution but it should produce the desired result
&{foreach ($esx in Get-VMHost){ ForEach-Object { $esx.ExtensionData.Summary.Hardware } | Select-object @{N="ESX Name";E={$esx.Name}},Vendor, Model, MemorySize, CpuModel, CpuMhz, NumCpuPkgs, NumCpuCores, NumCpuThreads, NumNics, NumHBAs}} |
ConvertTo-Html -title "VMware ESX server Hardware configuration" -body "<H2>VMware ESX server Hardware configuration.</H2>" | Out-File -Append $filelocation
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Not the most elegant solution but it should produce the desired result
&{foreach ($esx in Get-VMHost){ ForEach-Object { $esx.ExtensionData.Summary.Hardware } | Select-object @{N="ESX Name";E={$esx.Name}},Vendor, Model, MemorySize, CpuModel, CpuMhz, NumCpuPkgs, NumCpuCores, NumCpuThreads, NumNics, NumHBAs}} |
ConvertTo-Html -title "VMware ESX server Hardware configuration" -body "<H2>VMware ESX server Hardware configuration.</H2>" | Out-File -Append $filelocation
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Great, That does it.
thanks,
James Alexander
Team Lead
Enterprise Windows and Storage
10 Glenlake Parkway, Suite 800
Atlanta, GA, 30328
Direct Number: 678-387-4704