I have a flaky NIC that drops out from time to time, especially after resuming from hibernation. A drop-out corresponds to Vista's network status showing in the notification area as "Local Only". Is there a way of retrieving these status values (e.g. "Limited Connectivity", "Local Only", "Local and Internet") programmatically?
I am writing a powershell script that polls to see if the connection is down, and if so, resets the adapter. Currently I am trying to detect the connection state by pinging my ISP's DNS server. However, since the OS is already correctly identifying this condition, it would be much simpler if I could just retrieve this value.
Thanks!