VMware PowerCli Script to Get a list of all Storage paths and their policy settings

Following Script to Get a list of all Storage paths and their policy settings
————————————-

Connect-VIServer MYVISERVER

$ESX = get-vmhost “MyESXHost.mydomain.com” | Get-View

$Information = @()
foreach($disk in $esx.Config.StorageDevice.ScsiLun){
    $MyDetails = “” | Select-Object Name, Policy
    foreach($lun in $esx.Config.StorageDevice.MultipathInfo.Lun){
        if($disk.CanonicalName -eq $lun.Id){
            $MyDetails.Name = $disk.CanonicalName 
            $Mydetails.Policy = $lun.Policy.Policy
            $Information += $MyDetails
        }
    }
}
$Information

Leave a Reply

Your email address will not be published. Required fields are marked *