We all know that the Standard switch is normally used for the management network of the hosts, and this switch has configurable uplinks (for example Active & Standby uplinks).
Today I was analysing a host failure on the weekend where one of the uplinks went down but a few hosts went into network isolation- isolating themselves from the vCenter. I checked the Standard switch uplinks and they are both Active.
I then checked the Management PortGroup, as it too can have configured uplinks, and I found one of the uplinks configured as StandBy, and thus the reason why those hosts failed.
I now want to run a PowerShell script to check all hosts in the cluster and I came up with this, with help from an existing script I found:
My problem is with the returned values for "PortGroup Active NIC" & "PortGroup StandBy NIC" which appear like this:
If I run the command from the commandline, I get this:
My goal is to set the property "PortGroup Active NIC" to "vmnic0, vmnic3".
From the commandline, this seems to work:
I'm not sure how to do this in the original code tho.