mxy
mxy

Reputation: 37

How to Get MAC Address of VMs with Azure PowerShell

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

Answers (1)

4c74356b41
4c74356b41

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

Related Questions