PS: VM name + Datastore name + NAA ID

Import-Csv <Path>| foreach {
Get-VM $_.VMmachine | Select Name,@{N=”Datastore”;E={Get-Datastore -VM $_}} ,@{N=”DatastoreNAA”;E={ Get-Datastore -VM $_ | select @{N=’CanonicalName’;E={$_.ExtensionData.Info.Vmfs.Extent[0].DiskName}} }}
} | export-csv <Path>

 

Leave a comment