Not as sophisticated as Luc's, but easy to run nonethless and you can pass a datacetner or cluster.
Get-cluster cluster | get-vmhost | foreach {Write-Host; $_.Name; $_ | Get-Datastore | Select Name,@{N='Naa';E={($_ | Get-View).Info.Vmfs.Extent.Diskname}} }
Luc, I was having issues on this and was hoping you could help caus I'd like to actually use this myself. For this command how could I have it put the hostname lined up with each datastore?
Right now it looks like this:
hostname
Name NAA
datastore naa.12313123123123123
How could I have it look like this:
Hostname Name NAA
Hostname datastore naa.12313123123123123