The following script will export the VDS information for the uplinks, the port they are on and which pNIC is used per ESXi node.
$report = foreach($dvSw in Get-VDSwitch){
foreach($esx in (Get-View -id $dvSw.ExtensionData.Summary.HostMember)){
$proxy = $esx.Config.Network.ProxySwitch | where{$_.DvsUuid -eq $dvSw.ExtensionData.Uuid}
$pnicTab = @{}
$proxy.Spec.Backing.PnicSpec | %{
$pnicTab.Add($_.UplinkPortKey,$_.PnicDevice)
}
$proxy.UplinkPort |
Select @{N='vdSwitch';E={$dvSw.Name}},
@{N='VMHost';E={$esx.Name}},
@{N='vNIC';E={$pnicTab[$_.Key]}},
@{N='Uplink';E={$_.Value}},
@{N='Port';E={$_.Key}}
}
}
$report | Export-Csv C:\dvSw-Uplink.csv -NoTypeInformation -UseCulture