Command to Retrieve Physical Switch Name and Port Numbers to which a particular ESXi host vmnics are connected
vim-cmd hostsvc/net/query_networkhint | grep -i [Dp][eo][vr][It] |grep -v Capa | grep -v connected
Output format would be:
device = "vmnicX",
devId = "SwitchName",
portId = "GigabitEthernetX/Y"
vim-cmd hostsvc/net/query_networkhint | grep -i [Dp][eo][vr][It] |grep -v Capa | grep -v connected
Output format would be:
device = "vmnicX",
devId = "SwitchName",
portId = "GigabitEthernetX/Y"