J
jason.kor
I am trying to script a way that lowers the wireless binding order in
windows xp. We have LAN and wireless capabilities in our office and if
the wireless nic is set highest in the binding order it takes longer to
login into the LAN. I am working on a script that I received from
Microsoft and it seems ok, but doesn't change anything in the GUI when
I run it. I really appreciate any help or suggestions?
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
regValueDataMetric = "35"
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapter Where NetConnectionID = 'Wireless
Network Connection'")
For Each objItem in colItems
strMACAddress = objItem.MACAddress
Wscript.Echo "MACAddress: " & strMACAddress
Next
Set colNetCard = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration where
IPEnabled=TRUE")
For Each objNetCard in colNetCard
If objNetCard.MACAddress = strMACAddress Then
For Each strIPAddress in objNetCard.IPAddress
Wscript.Echo "Description: " & objNetCard.Description
Wscript.Echo "IP Address: " & strIPAddress
Wscript.Echo "IPConnectionMetric: " & objNetCard.IPConnectionMetric
objNetCard.SetIPConnectionMetric(regValueDataMetric)
Next
End If
Next
windows xp. We have LAN and wireless capabilities in our office and if
the wireless nic is set highest in the binding order it takes longer to
login into the LAN. I am working on a script that I received from
Microsoft and it seems ok, but doesn't change anything in the GUI when
I run it. I really appreciate any help or suggestions?
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
regValueDataMetric = "35"
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapter Where NetConnectionID = 'Wireless
Network Connection'")
For Each objItem in colItems
strMACAddress = objItem.MACAddress
Wscript.Echo "MACAddress: " & strMACAddress
Next
Set colNetCard = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration where
IPEnabled=TRUE")
For Each objNetCard in colNetCard
If objNetCard.MACAddress = strMACAddress Then
For Each strIPAddress in objNetCard.IPAddress
Wscript.Echo "Description: " & objNetCard.Description
Wscript.Echo "IP Address: " & strIPAddress
Wscript.Echo "IPConnectionMetric: " & objNetCard.IPConnectionMetric
objNetCard.SetIPConnectionMetric(regValueDataMetric)
Next
End If
Next