I have some PowerCLI data on VMs that comes in way such as this:
$vmlist = get-vm | select name, memoryGB, numCPU
and so on.
Based on the NAME of these VMs, I have a bunch of other info from other systems I need to aggregate into my report.
For example, I need to take the name of this VM, go over to Active directory, and get a bunch of other information on this computer name such as the OU it is in. I'd like to add this information as custom properties to each VM object that exists in the $vmlist array created above.
What is the cleanest way to accomplish this? Can I take the $vmlist array, and use it to query Active directory, and then add a custom property to $vmlist such as OrganizationalUnit?