Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Here is how to select physical NICs #19

Open
elekgeek opened this issue Dec 6, 2017 · 0 comments
Open

Here is how to select physical NICs #19

elekgeek opened this issue Dec 6, 2017 · 0 comments

Comments

@elekgeek
Copy link

elekgeek commented Dec 6, 2017

If IsObj($colItems) Then
For $objItem In $colItems
FileWriteLine($log, "[" & $objItem.NetConnectionID & "]")
FileWriteLine($log, "ProductName=" & $objItem.ProductName)
$value = $objItem.NetConnectionID
$GUID = $objItem.GUID
If StringLen($value) > 1 Then $Output = $Output & $value & "|"
$colItems2 = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE SettingID = '" & $GUID & "'", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
For $objItem2 In $colItems2
If $objItem.Index = $objItem2.Index Then
FileWriteLine($log, "SettingID=" & $objItem2.SettingID)
FileWriteLine($log, "IPAddress=" & $objItem2.IPAddress(0))
FileWriteLine($log, "MACAddress=" & $objItem2.MACAddress)
EndIf
Next
Next
Else
MsgBox(0, "WMI Output", "No WMI Objects Found for class: " & "Win32_NetworkAdapterConfiguration")
EndIf

it works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant