PowerCLI shortcode to find ESXi host using a Mac Address

There might be a situation that you need to look up an ESXi host with it’s Mac address especially when troubleshooting and tracing network connectivity issues.

Although you can use RVTools report to find the matching ESXi host but sometimes PowerCLI is just there and probably easier to run a single line code to grab the required information.

You can use the below single line PowerCLI to simply find which ESXi host owns the Mac address:

Get-VMHost | Get-VMHostNetworkAdapter | 
Where-Object {$_.Mac -eq "00:25:b5:01:00:1b"} | 
Select VMHost, Name, DeviceName, Mac

If there is an ESXi host in your vCenter environment that owns that Mac address then it will retrun the Hostname and the NIC name similar to the below:

VMHost                Name               Mac
------                ----               ---
ESXi01.mylab          vmnic9             00:25:b5:01:00:1b

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close