Automation

 View Only
  • 1.  get-view: how to use the filter option for host parent

    Posted Nov 08, 2011 07:34 PM

    I need to do a get-view on all the hosts in a cluster, I know I can use the get-vmhost -location to get all the hosts then do a get-view on each one. I found that if I do a get-view (get-cluster testCluster) this returns a MoRef equal to ClusterComputeResource-domain-c31 , when I do a get-view -viewtype hostsystem on a host in the same cluster, the parent returned is the moref from the get-view on the cluster. So I tied to do a:

    get-view -viewtype hostsystem -filter @{"Parent"="ClusterComputeResource-domain-c31"}

    But this doesn't return anything. How can I use the filter option to return a view of all the hosts in a cluster?

    Thanks



  • 2.  RE: get-view: how to use the filter option for host parent

    Posted Nov 08, 2011 07:58 PM

    Try it like this

    Get-View -ViewType HostSystem -Filter @{"Parent"="^domain-c31$"}