TheVMinator
Expert
Expert

Select VMname by Guest OS Hostname

I have an input file with a set of operating system hostnames.  I need to take this OS hostname from the input file and do a get-vm against vCenter

(Assume VM tools are installed on each VM and it is powered on so that the OS hostname is available)

If I have these 3 hostnames in my input file:

windows1

Windows2

windows3

How would I pull these and find the VM  names for each as seen in vCenter? 

Thanks!