Advertisement
Merzavets

Find VMware VM by mac-addresss

Nov 14th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $report =@()
  2. Get-VM | Get-View | %{
  3.  $VMname = $_.Name
  4.  $_.guest.net | where {$_.MacAddress -eq "00:50:56:4b:29:33"} | %{
  5.         $row = "" | Select VM, MAC
  6.         $row.VM = $VMname
  7.         $row.MAC = $_.MacAddress
  8.         $report += $row
  9.   }
  10.   }
  11. $report
  12.  
  13. # I've copied it from http://www.vmwareadmins.com/how-to-find-virtual-machine-name-from-the-mac-address-using-powercli/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement