LucD,
Your script ran and provided info, but some of the items are missing. IP, vPGName and PortGroupName.
HostName vNic PortGroupName ip MAC pNic vSwitch vPGName
-------- ---- ------------- -- --- ---- ------- -------
esxlab01.mylab.lab vmnic0 00:0c:29:9b:09:83 vmnic0 vSwitch0
esxlab01.mylab.lab vmnic1 00:0c:29:9b:09:8d vmnic1 vSwitch0
esxlab01.mylab.lab vmnic2 00:0c:29:9b:09:97 vmnic2 vSwitch1
esxlab01.mylab.lab vmnic3 00:0c:29:9b:09:a1 vmnic3 vSwitch1
It did put me on the right track but need some more slight modification. The modified script is now pulling the portgroup, but the pg name for the vswif0 is incorrect.
Output of attached script is below:
HostName vNic IPAddress MACAddress pNic vSwitch vPGName vLANID
-------- ---- --------- ---------- ---- ------- ------- ------
esxlab01.mylab.lab vmnic0 00:0c:29:9b:09:83 vmnic0 vSwitch0 Service Console,VM Network 0,0
esxlab01.mylab.lab vmnic1 00:0c:29:9b:09:8d vmnic1 vSwitch0 Service Console,VM Network 0,0
esxlab01.mylab.lab vmnic2 00:0c:29:9b:09:97 vmnic2 vSwitch1 Virtual Machine Network 0
esxlab01.mylab.lab vmnic3 00:0c:29:9b:09:a1 vmnic3 vSwitch1 Virtual Machine Network 0
esxlab01.mylab.lab vswif0 10.9.8.210 00:50:56:41:41:eb vswif0 Virtual Machine Network 0
I'll continue ot work on it...but maybe you'll spot the issue right away.