Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 210400

Re: How to find a VM through MAC only

$
0
0

You can run script from both links using powercli

 

I have tried script from first link and it worked.

 

C:\WINDOWS\system32\windowspowershell\v1.0 powershell.exe -PSConsoleFile  "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vmMac.ps1"  -command "connect-viserver -server <myVCenter> -user <myUser> -password <myPassword>


$strMacToFind = "00:50:56:83:00:69"

## return the .NET View object(s) for the VM(s) with the NIC w/ the given MAC

Get-View -Viewtype VirtualMachine -Property Name, Config.Hardware.Device | ?{$_.Config.Hardware.Device | ?{($_ -is [VMware.Vim.VirtualEthernetCard]) -and ($_.MacAddress -eq $strMacToFind)}}


Viewing all articles
Browse latest Browse all 210400

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>