Quick and dirty PowerCLI script to list out all VM MAC addresses

I needed a quick list of all MAC addresses in our VMWare environment and threw together this PowerCLI script.

$LOG_FILE = "C:\machines.txt"
$VI_SERVER = "your-virtual-center-server-here"
Connect-VIServer $VI_SERVER
get-vm | %{ $_ | select Name | out-file -filepath $LOG_FILE -append; $_ | Get-NetworkAdapter | out-file -filepath $LOG_FILE -append }

1 comment

  1. Don Peterson

    Thank you for your generosity of time and intellect in sharing your learnings on your website and making them available via search. I respect the time and effort needed to do this work and just want you to know that I appreciate it.


Leave a Reply

Your email address will not be published. Required fields are marked *