Thanks for the update, will need to include OCUM as well.
For WFA credential test, tried the following with POSH ( try/catch/finally, so it does not fail in a way that can stop the workflow row iteration 😞
function check_credential ( $array, $file )
{
$cred = ""
$cred = Get-WfaCredentials -HostName $array -errorAction SilentlyContinue
If ( $cred )
{ #1
$could_not_connect = 0
$resu = ""
try
{
if ($array -match "nas" )
{
Get-WFALogger -Info -message $("Trying connection to 7mode controller $array !! " )
$resu = Connect-WfaController -Array $array
Get-WFALogger -Info -message $("Connected to array $array !! " )
}
elseif ($array -match "ncs" ) #cdot!
{
Get-WFALogger -Info -message $("Trying connection to cdot cluster $array !! " )
$resu = Connect-WfaCluster $array
Get-WFALogger -Info -message $("Connected to cluster $array !! " )
}
}
catch
{
$could_not_connect = 1
Get-WFALogger -Info -message $("Could not connect to array $array . " )
}
finally
{
if ( $could_not_connect )
{
Get-WFALogger -Info -message $("Valid cred.Confirmed.Could not connect to array $array ." )
$liner = "WFA found credentials for $array but could not connect. l |Expected Value:Please connect to WFA as admin and update credentials for $array ( in case root/admin credentials changed please also update them in OCUM/OCPM ) |" + "`n"
Add-Content ".\$file" "$liner"
Exit
}
else
{
Get-WFALogger -Info -message $("Valid cred.Confirmed.Could connect to array $array ." )
}
} # end finally
} #end if cred
else
{
Get-WFALogger -Info -message $("WFA could not find valid credentials for $array. " )
$liner = "WFA could not find credentials for $array |Expected Value:Please connect to WFA as admin and add root/admin credentials for $array|" + "`n"
Add-Content ".\$file" "$liner"
Exit
}
} # end check credential function