eeg3
Commander
Commander

Replacing VMHostID with Host's Name

I'm running the following command:

Get-VMHost | Get-VirtualPortGroup | Select VMHostId,Name,VirtualSwitch,VirtualSwitchName,VLanId | Export-Csv "PathHere"

Which returns all of the information I want, except it puts the VMHostId instead of the actual host's name:

VMHostIdNameVirtualSwitchVirtualSwitchNameVLanId
HostSystem-host-97975Service ConsolevSwitch0vSwitch00

I don't see Parent or any other similar options under the Select from within the Get-VirtualPortGroup. What is the proper way to get the Host's actual name instead of the VMHostId?

Blog: http://blog.eeg3.net
Tags (1)