I had tried Luc's script before and did not get it working. So I gave my previous example. Now I see that IpAddress in Guest.IpAddress is case sensitive. I wrote Guest.IPAddress in my test script and that gave an error. So be carefull to use the right case. :smileywink:
The error I got was:
[vSphere PowerCLI] C:\users\robert> Get-View -ViewType VirtualMachine -Filter @{"Guest.IPAddress"="10.33.126.40"}
Get-View : 21-2-2011 13:15:33 Get-View
At line:1 char:9
+ Get-View <<<< -ViewType VirtualMachine -Filter @{"Guest.IPAddress"="10.33.126.40"}
+ CategoryInfo : NotSpecified: (:) [Get-View], InvalidProperty
+ FullyQualifiedErrorId : Client20_MoServiceImpl_GetNetInteropEntityView_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView