new1234.jpg
Home > VMware > VMware: Easy menu to find VM network adapter by MAC address

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

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

sanderdaems

Sander Daems is founder and author of this blog and working as a Sr. Infrastructure Consultant by IT-Value. Sander has over 10 years experience in IT, primary focus: virtualization, storage and SBC

More Posts - Website

Follow Me:
TwitterLinkedIn

  1. Horace
    November 3rd, 2011  (Quote) at 20:51  (Quote) | #1

    Sweet write, very thank you for writing this script

  2. CLI user
    November 11th, 2011  (Quote) at 03:57  (Quote) | #2

    Great! Thanks for sharing!

  3. Jeff
    November 14th, 2011  (Quote) at 10:07  (Quote) | #3

    Very handy script, thanks Sander

  4. jamnwm
    November 25th, 2011  (Quote) at 21:43  (Quote) | #4

    Does this also work to find ip-addressess?

  5. PeterS
    November 28th, 2011  (Quote) at 12:48  (Quote) | #5

    Nice, used this script today.. works like a charm

  6. Sagar G
    May 8th, 2015  (Quote) at 13:16  (Quote) | #6

    Thanks a lot, this script saved lots of time

  1. No trackbacks yet.