Hi
the following is not returning correctly. I was wondering if there was actual data but not being shown? It always comes back as "Nic Teaming Configured Properly" weather i have a nic in standby mode or not.
Any help would be appreciated.
Thank you
$esxhst = "Hostname"
$NicTeaming = Get-VirtualSwitch -VMHost $esxhst | Get-NicTeamingPolicy
if ( $NicTeaming.standbyNic -and $NicTeaming.UnusedNic -Eq $Null )
{
$NicTeamPolicy = "Nic Teaming Configured Properly"
}
else
{ $NicTeamPolicy = "Nic Teaming NOT Configured properly" }
Not sure if the expression is what you actually want.
Don't you want to check if there no standby nor unused NICs?
Then that line should probably be
if ( $NicTeaming.standbyNic -eq $null -and $NicTeaming.UnusedNic -Eq $Null )
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Not sure if the expression is what you actually want.
Don't you want to check if there no standby nor unused NICs?
Then that line should probably be
if ( $NicTeaming.standbyNic -eq $null -and $NicTeaming.UnusedNic -Eq $Null )
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you so much. That was it. It now returns the correct response.
Thanks again...