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.
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
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
Hi LucD,
There is a VM with Generated, what does that mean ? How do we get that in the output ?
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
Thank you very much...that worked 🙂