Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 258290

Re: finding missing datastore _powercli

$
0
0

You can use the MultipleHostAccess property to filter local datastores out.

 

$cluster=Get-Cluster MyCluster

$dsNames=(Get-Datastore-RelatedObject $cluster|where{$_.ExtensionData.Summary.MultipleHostAccess}).Name


Get-VMHost-Location $cluster|where{$_.DatastoreIdList.Count-ne$dsNames.Count}|

Select Name,

    @{N='Cluster DS Count';E={$dsNames.Count}},

    @{N='ESXi DS Count';E={$_.DatastoreIdList.Count}},

    @{N='Missing DS';E={

        $script:dsEsx=(Get-View-Id $_.DatastoreIdList-Property Name).Name

        ($dsNames|where{$script:dsEsx-notcontains$_})-join'|'}}


Viewing all articles
Browse latest Browse all 258290


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>