VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

How to get VM MAC details

Hi,

I am trying to get the details of network card MAC from all the VMs in the vcenter, if they are manual or automatic assigned ?

please help, how can I get those.

ganapa2000_0-1625546766754.png

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Just replace the calculated property with

@{N='MACType';E={$_.ExtensionData.AddressType}}

But be aware that you now will see Manual, Generated and Assigned. 


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

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

You could do something like this

Get-VM -PipelineVariable vm |
Get-NetworkAdapter |
Select @{N='VM';E={$vm.Name}},
  @{N='NIC';E={$_.Name}},
  MacAddress,
  @{N='MACType';E={
    if($_.ExtensionData.AddressType -eq 'manual'){'Manual'}else{'Automatic'}}}


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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Hi LucD,

There is a VM with Generated, what does that mean ? How do we get that in the output ?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Just replace the calculated property with

@{N='MACType';E={$_.ExtensionData.AddressType}}

But be aware that you now will see Manual, Generated and Assigned. 


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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Thank you very much...that worked 🙂

0 Kudos