I ran into an issue today where a server was complaining about a duplicate MAC address. Since almost all of our servers were virtual, I thought the best step (after doing an arp -a command locally and seeing if the offending IP address/MAC address was listed – which it wasn’t) would be to do a quick Google to see if there was an easy way without checking each VM.
Of course there is, thanks to Powershell. I quickly found this blog post from The Daily Admin and gave it a try. There was one slight change I had to make to get it to work:
Using the “Virtual Machine Manager Command Shell” I tried the command from the link above:
Get-VMMServer | get-vm | Get-VirtualNetworkAdapter | select name,EthernetAddress | export-csv “c:\temp\VM_Macs.csv”
It prompted for a Computer name. After working out you needed to specify your SCVMM server in the first part after ‘Get-VMMServer’ as per this:
Get-VMMServer “ScvmmServerName”| get-vm | Get-VirtualNetworkAdapter | select name,EthernetAddress | export-csv “c:\temp\VM_Macs.csv”
It worked perfectly. The resulting CSV file had a full list of the MAC addresses, which helped me narrow down what I was looking for.
Full credit to The Daily Admin at http://www.thedailyadmin.com/ !