dwischnewski

Running the WQL

SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True

in Windows XP returns all "real" network adapters, where I can set the IP addresses and that works as well.

Running the same WQL in Vista as administrator (and started the program with "Run as administrator") returns no network adapters on a system that does have them (same setup, dual boot, just on Vista)

Any ideas why I get this strange behaviour

Thanks,
Daniel




Re: Windows SDK None of the network adapters have "IPEnabled = True" set

dwischnewski

Any ideas anyone

Any questions regarding my question I am sitting on hot coals here ;)






Re: Windows SDK None of the network adapters have "IPEnabled = True" set

MVP User

Any ideas anyone

Any questions regarding my question I am sitting on hot coals here ;)


Works for me.
Did you try to run this query using wbemtest.exe
 
Willy.
 




Re: Windows SDK None of the network adapters have "IPEnabled = True" set

dwischnewski

Let's see... was there any Windows Update for Vista within the last few days which changed the behaviour... I swear, the same tool did not get any positive results two weeks ago. Same for any script I have, they all work now, no changes done.

Until now, I had to allow WMI Scripting through the Firewall - I found this setting last Friday...

Anyway, now it works! Great and thanks.

Some checks in a VM give me reason to believe that either Update KB915597 - Def 1.15.2231.7 or Update KB915597 - Def 1.15.2233.6 solve the problem :)






Re: Windows SDK None of the network adapters have "IPEnabled = True" set

Florider06

Hello,

I have got the same problem when i run this code under Vista ('windows update' updated and 'Windows Firewall off') :

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim mc As ManagementClass

mc = New ManagementClass("Win32_NetworkAdapterConfiguration")

Dim moc As ManagementObjectCollection = mc.GetInstances()

Dim arr As New ArrayList

Dim mo As ManagementObject

For Each mo In moc

If mo.Item("IPEnabled") = True Then

arr.Add(mo.Item("MacAddress").ToString)

End If

Next

mo = Nothing

mc = Nothing

Me.ListBox1.DataSource = arr

End Sub

The same program works great under XP (the listbox contains the MAC address of the network adapter) but not under Vista (the listbox is empty).

In fact, the network adapter is activated but the cable is disconnected.

If i connect the cable, the program detects the network adapter under XP and Vista, but i don't want to have to connect it.

I think that "IPEnabled" property doesn't work in the same way under Vista as under XP.

I use Visual Studio 2003 with the Framework 1.1.

Can anyone help me

Thanks,