Thanks Luc,
I don't think that will help me (or should I say, I don't yet understand how it will help me)
My script is below. From it, I want to collect all unique datastore names, so that in turn I can get the NAA ID's for these DataStores
$cluster = (Read-Host "Enter Target Cluster name")
$outputfile = "./$cluster-" + (Get-Date -Format yyyy-MMM-dd-HHmm) + ".csv"
$report=@()
foreach ($v in (Get-Cluster $cluster | Get-VM)) {
$ReportProp=[ordered]@{
'VMname'=$v.name;
'Cluster'=$v.VMHost.Parent
}
$ds_count = 1
$ds = $v | Get-Datastore | foreach {
$ReportProp.Add("DataStore$($ds_count) Name",$_.Name)
$ReportProp.Add("DataStore$($ds_count) VMFS Version",$_.FileSystemVersion.split(".")[0])
$ReportProp.Add("DataStore$($ds_count) Capacity GB",[math]::round($_.CapacityGB,2))
$ReportProp.Add("DataStore$($ds_count) Free Space GB",[math]::round($_.FreeSpaceGB,2))
$ds_count++
}
$report += New-Object -TypeName psobject -Property $ReportProp
}
$report |
Sort-Object -Property {($_ | Get-Member -MemberType NoteProperty).Count } -Descending |
Export-Csv $outputfile -NoTypeInformation -UseCulture
Invoke-Item $outputfile
By the way, it was great hearing you speak in person at VMworld last week.