Reputation: 37
Does anyone know how to get Mac address of vms in Azure through Azure PowerShell? i know i can get it with WMI or something else inside the VM, but i don't know how can i do that without logging on the VM.
Upvotes: 2
Views: 5651
Reputation: 72191
Use the Get-AzureRmNetworkInterface
command and the MacAddress
property the resulting object has:
(Get-AzureRmNetworkInterface -ResourceGroupName %rgName%).MacAddress
this will list all the macs of the network interfaces in a resource group, to be more specific you could add the -Name
parameter.
(Get-AzureRmNetworkInterface -ResourceGroupName %rgName% -Name %nicName%).MacAddress
Upvotes: 2