Use below script to generate data store utilization report cluster wise :
$report = @() foreach($cluster in Get-Cluster){ Get-VMHost -Location $cluster | Get-Datastore | %{ $info = "" | select DataCenter, Cluster, Name, Capacity, Provisioned, Available,Percentfree $info.Datacenter = $_.Datacenter $info.Cluster = $cluster.Name $info.Name = $_.Name $info.Capacity = [math]::Round($_.capacityMB/1024,2) $info.Provisioned = [math]::Round(($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB,2) $info.Available = [math]::Round($info.Capacity - $info.Provisioned,2) $info.Percentfree = [math]::Round(((100* ($info.Available))/ ($info.Capacity)),0) $report += $info } } $report | Export-Csv "C:\Report.csv" -NoTypeInformation -UseCulture
Thanks hope you like it.
Rajiv Pandey.