Hello Everyone,
We want to export the status of all services running on all ESX Hosts for an audit. Is there a PowerCLI script to export this data in CSV for all ESX hosts from multiple vCenters.
Do you mean all the services returned by Get-VMHostService?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes the result returned by Get-VMHostService
You could do something like this.
It assumes the credentials for all vCenters are the same.
$vcNames = 'vc1','vc2','vc3'
Connect-VIServer -Server $vcNames -Credential $cred
Get-VMHost | Get-VMHostService |
Select @{N='VMHost';E={$_.VMHost.Name}},Key,Running |
Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference