Hi guys,
I use PowerCLI a lot, primarily to export information on our virtual estate & import into a SQL database for further querying.
I want to audit the ImageProfile field across our virtual estate, however I'm struggling to find a way of getting this value from the hosts using PowerCLI.
I am having to execute Get-ESXCLI which requires a lot more permission than my readonly user account has.
This is what I've knocked up, however I can't run with this using a read-only user account:
$Data = Get-VMHost | ForEach { $esxcli = Get-EsxCli -VMhost $_ $_ | Select Name, @{Expression={$_.Client.ServerUri.Split("@") | Select -last 1};Label="vCenter"}, @{Expression={$esxcli.software.profile.get().Name};Label="ImageProfile"} }
Is there any other method of extracting this information?
Thanks