Created
September 17, 2014 14:50
-
-
Save fr0gger03/4e1556a3fff12cc14ea4 to your computer and use it in GitHub Desktop.
PowerCLI: Get-View samples for discovering VM to VMFS to LUN NAA mappings...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you must connect and authenticate to a vCenter server | |
# use Connect-VIServer to do so | |
# establish Export file name | |
$csvname = Read-Host 'Please provide the file path and name for your CSV export' | |
# Use Get-View, and filter by datastore type, then | |
# select specific properties and export to CSV | |
Get-View -ViewType datastore |Select-Object name,@{n='NAA';e={$_.info.vmfs.extent.diskname}} |Sort-Object name | Export-Csv $csvname | |
# establish Export file name | |
$csvname = Read-Host 'Please provide the file path and name for your CSV export' | |
# Use Get-View, and filter by virtual machine type, then | |
# select specific properties and export to CSV | |
Get-View -ViewType virtualmachine |Select-Object name,@{n="disk layout";e={$_.layoutex.file.name}},@{n="VMDK Size";e={$_.layoutex.file.size}} |Sort-Object name | Export-Csv $csvname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment