Contains a list of all VM’s in the company in a separate column is the vCenter Server it lives on.
I need to do a ForEach loop to take the server name from the first csv and search for it in the second csv file and return to me the column of the vCenter Server.
I have tried this by turning the second CSV file into a hash table, but when I seach it outputs the vCenter server of all servers, not the ones in my first CSV.
You mean something like that? I’m not certain where the hash table comes into play. This assumes each CSV has a “servername” column that contains what you want, but I’m not entirely certain from your post what the data actually is, so I imagine you’ll have to adjust. I’m also at a loss as to what Group-Object was accomplishing for you, so it’s entirely possible I’m missing your goal entirely.
Thanks for the reply.
So my first csv has one column “ServerName”
The second csv has 3 columns: “VmName”, “ViServer”, and “FQDN”.
I need to do a ForEach loop on the servers in the first csv, and search the second csv for the same server name, then return the vCenter server listed in the second column.