Hello, jstroehmann-
How about something like:
## get the .Net View objects for all of the host systems
Get-View -ViewType HostSystem -Property Name,Config.Network.Pnic,Hardware.PciDevice | %{
## store pipeline variable for later use
$viewHost = $_
## for each PhysicalNic on the host, output a bit of info
$viewHost.Config.Network.Pnic | Select @{n="HostName"; e={$viewHost.Name}},Device,MAC,@{n="NicDisplayName"; e={$oPNic = $_; ($viewHost.Hardware.PciDevice | ?{$_.Id -eq $oPNic.Pci}).DeviceName}}
} | ft -auto
It grabs the .Net View object of all of the HostSystems, and then displays some info like hostname, the VMNic name, its MAC address, and then the display name that you mentioned. You could, of course, do something with the output other than send it to Format-Table. How does that do for you?
Hello, jstroehmann-
How about something like:
## get the .Net View objects for all of the host systems
Get-View -ViewType HostSystem -Property Name,Config.Network.Pnic,Hardware.PciDevice | %{
## store pipeline variable for later use
$viewHost = $_
## for each PhysicalNic on the host, output a bit of info
$viewHost.Config.Network.Pnic | Select @{n="HostName"; e={$viewHost.Name}},Device,MAC,@{n="NicDisplayName"; e={$oPNic = $_; ($viewHost.Hardware.PciDevice | ?{$_.Id -eq $oPNic.Pci}).DeviceName}}
} | ft -auto
It grabs the .Net View object of all of the HostSystems, and then displays some info like hostname, the VMNic name, its MAC address, and then the display name that you mentioned. You could, of course, do something with the output other than send it to Format-Table. How does that do for you?
appears to work perfectly - much appreciated!
(EX output)
hostname.domain.com vmnic0 1c:a1:df:72:12:d7 NC370i Multifunction Gigabit Serve...