We have an multi datacenter environment with linked vCenters. I'm trying to build a PowerCLI script to create a csv report listing all VMs with PowerState, ToolsVersion and ToolsStatus.
I've made it that far (by digging through these forums ), but I also want to include Datacenter and Cluster for the VMs so the report can be sorted/filtered in a spreadsheet by those values. I'm a PowerCLI noob so I'm getting a bit lost.
Here's what I have so far... the script does a connect-viserver to each of the vCenters and then runs this and pipes it to Export-CSV:
Any help in getting the datacenter and cluster info in there would be greatly appreciated!
Thanks,
Darryl