Hi All,
How can I query the host profile and associated hosts with it? The closest thing I get is this.
(Get-VMhostProfile hostprofilename).extensiondata.entity
Type Value
----- ------
HostSystem host-3026
HostSystem host-3028
But, I am not getting the hostname and get only host value.
Try like this
Get-VMHostProfile |
Select Name,
@{N='VMHost';E={(Get-View -Id $_.ExtensionData.Entity).Name -join '|'}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
Get-VMHostProfile |
Select Name,
@{N='VMHost';E={(Get-View -Id $_.ExtensionData.Entity).Name -join '|'}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you Master.LucD
Get-View . This is it.
Yup, the moment you see a MoRef, you can get the object it is pointing to with the Get-View cmdlet.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Sorry about necroing a 3 year old thread, but is there a reference back to Auto Deploy rules? We do not apply Host Profiles directly to clusters or ESXi hosts, so there is not a MoRef to those objects.
I know I can just run Get-DeployRuleSet to see which Host Profiles are referenced to which rules, but looking for a one-liner that will do both for me, if possible.