Fix NIC settings fallback to WMI#725
Conversation
|
While reviewing this code, looks like i found a major issue with the original code.
|
|
You mean this one? |
|
Yep, that is the one. |
|
I was wondering what this block was for. Think the |
If the registry goes likes this: ``` 0011 0013 0016 0017 ``` We will fail to go past 0015 as we don't reset the retry counter on the next successful attempt. This fixes that broken logic. Hopefully, there just isn't a break in the numbers greater than 3.
|
Received feedback from customer that the WMI fallback works with the fix proposed. |
|
Except the code is written correctly, took a closer look at it last night and understood what was going on a little bit more. Will push out additional changes here today. |
Issue:
Fallback to WMI to query NIC settings was not working properly in some scenarios. If WMI was used to query the NIC settings, certain information was missing (IP addresses ...).
Reason:
There was no proper implementation to return the IP addresses in WMI scenario. We don't have all the information available which we get when using CIM with the latest cmdlets so this should be considered as a fallback just in case.
Fix:
Throwwhen we don't get any result viaGet-NetworkConfiguration. Added some logic to get the IP addresses, subnet mask and gateway.Validation:
Validated in lab and with affected customer. Please do not merge yet. Might require some more adjustments.