VMware Cloud Community
Lunchb0x8
Contributor
Contributor

Trouble getting full output from script sourced on this forum - Obtaining vNIC, MAC, IP and Network name

I am using a script I found here, and trying to get PowerCLI to output a CSV of all VMs in an instance to ensure when these VMs are manually cloned and presented in another instance (don't ask, long story, bad planning) for a DR test, that we can confirm the NICs come across as they were in the source, MAC and all.

Attached file is the script I am using, but I get the following;

VM, vNIC, IP, Portgroup, VLANId, VLAN, Type, SwitchType

testvwotxa202, Network adapter 1, 16.48.33.148,

Note, nothing for Portgroup, VLANid, VLAN, Type etc.

Any thoughts?

0 Kudos
3 Replies
LucD
Leadership
Leadership

That looks like some of the VMs might not be connected to a portgroup.

Can you run the following for one of those VMs?

Get-VM -Name MyVM | Get-NetworkAdapter | Select *


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Lunchb0x8
Contributor
Contributor

I am seeing details on NetworkName for each interface.

Example ;

MacAddress: <shows MAC address>

NetworkName: <Name of configured distributed port group>

0 Kudos
LucD
Leadership
Leadership

Can you check if the following actually shows those VMs in the output from the following?
And if the port number you see on the switch, corresponds with the port number you see on the VM's vNIC?

Get-VDSwitch -Name MyVDS | Get-VDPort


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos