Here is a PowerShell script to list datastore information per cluster

Here is a PowerShell script to list datastore information per cluster

$clusters = get-cluster
aforeach ($cluster in $clusters)
{
    $vmhosts = $cluster | get-vmhost
    $firsthost = $vmhosts[0]
    $datastores = $firsthost | get-datastore | % {(Get-View $_.ID).summary}
    foreach ($datastore in $datastores)
    {
        $datastore | select-object @{Name = "Date"; Expression = {get-date}}, @{Name = "Cluster"; Expression = {$cluster.name}}, URL, Name, Freespace, Capacity
           }
        }

http://www.vmwarescripting.com

This document was generated from the following thread: 

Version history
Revision #:
1 of 1
Last update:
‎02-10-2009 06:31 AM
Updated by: