We have multiple vCenters and I am trying to find a way via PowerCLI to search from a list of VM's (CSV File) to find the vCenter that VM is in.
There is an area of the Communities dedicated to PowerCLI, I have reported your post to the volunteer moderators asking them to move it there.
You could do (assuming the VM names are in a column named 'Name')
Import-Csv -File .\vmnames.csv -UseCulture |
Foreach-Object -Process {
Get-VM -Name $_.Name |
Select Name,
@{N='vCenter';E={([System.Uri]$_.ExtensionData.Client.ServiceUrl).Host}}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference