Post date: Jul 24, 2013 8:05:46 PM
Written to audit Default Path Selection Policies for all hosts. This will return all hosts and incorrect configurations that need to be resolved.
#Get all Hosts
$vHs = Get-VMHost
ForEach($vH in $vHs){
#Getting ESX CLI for each Host
$vHcli = Get-EsxCli -VMHost $vH
#Does it have the correct PSP for ALUA
$vHcli.storage.nmp.satp.list() | Where {$_.Name -eq "VMW_SATP_ALUA" -and $_.DefaultPSP -ne "VMW_PSP_RR"} | Select @{N="Cluster";E={$vH.Parent.Name}},@{N="VMHost";E={$vH.Name}},DefaultPSP,Name
#Does it have the correct PSP for IBM SVC
$vHcli.storage.nmp.satp.list() | Where {$_.Name -eq "VMW_SATP_SVC" -and $_.DefaultPSP -ne "VMW_PSP_RR"} | Select @{N="Cluster";E={$vH.Parent.Name}},@{N="VMHost";E={$vH.Name}},DefaultPSP,Name
#Does it have the correct PSP for Defaults
$vHcli.storage.nmp.satp.list() | Where {$_.Name -eq "VMW_SATP_DEFAULT_AA" -and $_.DefaultPSP -ne "VMW_PSP_RR"} | Select @{N="Cluster";E={$vH.Parent.Name}},@{N="VMHost";E={$vH.Name}},DefaultPSP,Name
}