Finding a UCS Service Profile from the MAC Address

Quick snippet on how to find the name of a service profile given the MAC address.

I found this useful as when troubleshooting ESXi locks, the MAC address of the locking host is shown and sadly not the name. Once I had the name I was able to continue debugging my problem 🙂

Get-UCSCentralServiceProfile | % { $h = $_.Name; $res = $_ | Get-UcsCentralVnic | ? { $_.Addr -eq "<MAC address here>" }; if ($res -ne $null) { Write-Host $h; } }

This will work with UCS domains not joined to Central (and having global service profiles) – change the code by removing the word “Central” from the cmdlets.