Share via

Interface Index Value Change

Anonymous
2018-01-02T22:44:14+00:00

Q: In Windows 10 Pro, beside malware, what would cause an interface index value to change on its own?

Scenario:

Powershell execution policy = allsigned

Only a specific user group has execute permissions on the script and the script is signed.

A Powershell script is run on a laptop by the end user which changes the network settings of the device based on one of two locations. No, DHCP is not an option and why is irrelevant; also, the Powershell script has been running without issues for almost 7 months now. The script has a variable which contains the interface index value (2) of the Ethernet adapter as it was listed at the time the script was composed. The end user then goes to run the script as normal except this time the script fails with the following error message:

"Remove-NetIPAddress : No matching MSFT_NetIPAddress object found by CIM query for instances of the ROOT/StandardCimv2/MSFT_NetIPAddress class on the CIM server: SELECT * FROM MSFT_NetIPAddress WHERE ((InterfaceIndex = 2)) AND ((AddressFamily = 2)). Verify query parameters and retry..."

When the interface index for the Ethernet adapter is checked you notice that its value, which used to be a 2, is now a 3. What caused this to change?

P.S.

The variable was being declared as:

$intIndex = 2

but is now being declared as:

$intIndex = (Get-NetIPAddress|where{$_.InterfaceAlias -eq 'Ethernet' -and $_.AddressFamily -eq 'IPv4'}).InterfaceIndex

and the revised declaration has resolved the error message being generated.

Windows for home | Windows 10 | Internet and connectivity

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. Anonymous
    2018-01-03T01:54:34+00:00

    Hi,

    Your concern regarding the sudden change of the Interface Index value along with your current network configuration is best facilitated in our TechNet forums. The community includes IT Professionals that would be able to share their expertise in relation to your concern. To visit the site, click on this link.

    Note: We'd also recommend checking this thread from time to time as there might be members of our community that would like to provide their insights here.

    Let us know should you have other concerns that need assistance.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful