10 Jul 2012

Powershell one-liner to find XenServer guest by MAC address

In a previous post I showed a Powershell one-liner to find a vSphere client based on a MAC address search string. This time I’ll do the same for Citrix XenServer.

$vif = get-xenserver:VIF | ? { $_.MAC -match "ce:e2:b7:56:85:7f"};(Get-XenServer:VIF.VM -VIF $vif.uuid).name_label

Of course you have to install the XenServer PoSH SDK and connect to a XenServer / Pool prior issuing the command above.