VMware Cloud Community
AnilCH
Contributor
Contributor

How to pull Host connection Missing information in Datastore Cluster using Powershell

I am trying to pull Host connection Missing information which we see in Datastore Cluster using web client through powershell script. I tried Get-datastoreCluster & Get-Datastore but I am not able to get that particular information directly. Please help

1 Reply
pwilk
Hot Shot
Hot Shot

Take a look at the answer to this very similar question:VMware PowerCLI Forum - VMware {code}

Quote:

$DatastoreCluster="MyDatastoreClusterName"

$DSClusterView = Get-View -ViewType StoragePod -Filter @{"Name"="^$DatastoreCluster$"} -Property Name,ChildEntity $DSCDatastores = Get-View -Id $DSClusterView.ChildEntity -Property Name,Host

# Show all hosts that have this datastore mounted:

foreach($ds in $DSCDatastores){

     Get-View -Id $ds.Host.Key -Property Name |

     Select @{N='DSC';E={$DatastoreCluster}},

          @{N='Datastore';E={$ds.Name}},

          @{N='VMHost';E={$_.Name}}

}

Please let me know if that's something you were looking for.

Cheers, Paul Wilk