VMware: Easy menu to find VM network adapter by MAC address

6

Last week I need to locate some traffic from physical switches to my virtual environment.. I need to find out which MAC address belong to which virtual machine (+ adapter).. time to script this include menu

#====================================================================#
#   SCRIPT:        Find_VM_by_MAC_address_menu.ps1                   #
#   FUNCTION:      Find VM (+ adapter) by MAC address with easy menu #
#   OWNER:         Sander Daems                                      #
#   CREATED:       11/01/2011                                        #
#   MODIFIED:      11/01/2011                                        #
#   VERSION:       v.1.0                                             #
#====================================================================#
#   CHANGELOG:                                                       #
#                                                                    #
#    v.1.0                                                           #
#	 - Created script;                                               #
#                                                                    #
#====================================================================#
#   HOST - CUSTOM DEFINITIONS                                        #
#====================================================================#
Write-Host "Let's find that damn address" -foregroundcolor green
#====================================================================#
$cluster = read-host "Select Cluster name"
$macaddress = read-host "Select MAC Address to find"
#====================================================================#
#   Script                                                           #
#====================================================================#
Get-Cluster $cluster | Get-VM | Get-NetworkAdapter | Where-Object {$_.MacAddress -eq "$macaddress"} | Format-List -Property *
#====================================================================#

image

About Author

6 thoughts on “VMware: Easy menu to find VM network adapter by MAC address

Leave a Reply

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