vAdventures

Export all active and standby Distributed Switch Portgroup uplink ports using PowerCLI

Just a quick command I used. Maybe it will be useful for someone as well.

I thought about the easiest way to check for all active and standby uplink ports on all vSphere Distributed Switch portgroups in my datacenter, for documentation purposes.

You could easily check the settings on each portgroup by navigating to the Distributed Switch portgroup – Configure – Properties – Edit – Teaming and Failover. But it could be a bit time consuming if there are several portgroups.

Using this PowerCLI command will output all configuration:

Get-VDPortgroup | Get-VDUplinkTeamingPolicy | Format-Table VDPortgroup,ActiveUplinkPort,StandbyUplinkPort,EnableFailback,UnusedUplinkP
ort,LoadBalancingPolicy

TeamViewer.jpg

If needed the output can be written into a csv-file by adding Out-File parameter:

Get-VDPortgroup | Get-VDUplinkTeamingPolicy | Format-Table VDPortgroup,ActiveUplinkPort,StandbyUplinkPort,EnableFailback,UnusedUplinkP
ort,LoadBalancingPolicy | Out-File -FilePath D:\Uplinks.csv