This works I would like to share it in the community also.
Add-PSsnapin VMware.VimAutomation.Core
$defaultpsp = "VMW_PSP_RR"
$psp = "VMW_PSP_RR"
$satp1 = "VMW_SATP_DEFAULT_AA"
Connect-VIServer -Server "xxx" -User "xxx" -Password "xxx"
$esxhosts = get-cluster | Get-VMHost
foreach($esx in $esxhosts){
$esxcli = Get-EsxCli -VMHost $esx -ErrorAction SilentlyContinue
if($esxcli){
$nmpdevlist = $esxcli.storage.nmp.device.list() | Where {$_.StorageArrayType -eq $satp1}
foreach($dev in $nmpdevlist){
$esxcli.storage.nmp.device.set($false, $dev.device, $psp) | Out-Null
}
$esxcli.storage.nmp.satp.set($true, $defaultpsp, $satp1) | Out-Null
}
}
Disconnect-VIServer -Server "xxx" -Confirm:$false