Hi All,
I use the following command to read the contens of the field: driverdiscription:
For Each subkey In arrSubKeys
My script returns two subkeys 0000 and 0001
But if I use regedit I can see that there are 9 subkeys. The subkeys 0000 - 0008.
My first nic has the key 0001 and my second nic has the subkey 0002.
Because my script reads only two subkeys in this case key 0000 and 0001 I am not able to read my second nic.
Any idea how to solve this?
Thanks in advance,
Johan
I use the following command to read the contens of the field: driverdiscription:
For Each subkey In arrSubKeys
My script returns two subkeys 0000 and 0001
But if I use regedit I can see that there are 9 subkeys. The subkeys 0000 - 0008.
My first nic has the key 0001 and my second nic has the subkey 0002.
Because my script reads only two subkeys in this case key 0000 and 0001 I am not able to read my second nic.
Any idea how to solve this?
Thanks in advance,
Johan
Code:
Sub ZoekNetwerkKaarten(strComputer)
Dim objReg
Dim blnNicFound
Dim strKeyPath,arrSubKeys,subkey,strValue
On Error Resume Next
blnNicFound = True
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
If Err Then
WScript.Echo("Fout tijdens het lezen van het register op: " & strComputer)
Exit Sub
Else
strKeyPath = "System\Currentcontrolset\Control\Class\{4D36E972-E325-11CE-BFC1-08002be10318}"
objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
logfile.WriteLine(VisueleKaderlijnNetwerkSpeedInfo + vbNewLine)
For Each subkey In arrSubKeys
objReg.GetStringvalue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey,"DriverDesc", strValue
DebugMessage("SubKey: " & subkey)
DebugMessage("strValue: " & strValue)
Select Case strValue
Case "3Com EtherLink XL 10/100 PCI TX NIC (3C905B-TX)"
WScript.Echo "** Controleer de netwerk instelling handmatig! **"
Exit Sub
Case "SysKonnect SK-9521 V2.0 10/100/1000Base-T Adapter, PCI, Copper RJ-45"
NetwerkSnelheid = LeesVerbindingsSnelheid (strKeyPath & "\" & subkey, "ConnectionType_A", strComputer, strValue)
If NetwerkSnelheid = "" Then
NetwerkSnelheid = LeesVerbindingsSnelheid (strKeyPath & "\" & subkey, "*SpeedDuplex", strComputer, strValue)
End If
If NetwerkSnelheid = "0" Then
DuplexSnelheid = "Auto Detect"
End If
If NetwerkSnelheid = "1" Then
DuplexSnelheid = "10 Mbps/Half Duplex"
End If
If NetwerkSnelheid = "2" Then
DuplexSnelheid = "10 Mbps/Full Duplex"
End If
If NetwerkSnelheid = "3" Then
DuplexSnelheid = "100 Mbps/Half Duplex"
End If
If NetwerkSnelheid = "4" Then
DuplexSnelheid = "100 Mbps/Full Duplex"
End If
If NetwerkSnelheid = "5" Then
DuplexSnelheid = "Auto-negotiate 1000Mbps"
End If
logfile.WriteLine " Netwerk snelheid voor SysKonnect SK-9521 V2.0 10/100/1000Base-T Adapter, PCI, Copper RJ-45 staat ingesteld op: " & DuplexSnelheid
Exit Sub
Case "Broadcom NetXtreme Gigabit Ethernet", _
"Broadcom NetXtreme 57xx Gigabit Controller"
NetwerkSnelheid = LeesVerbindingsSnelheid (strKeyPath & "\" & subkey, "RequestedMediaType", strComputer, strValue)
If NetwerkSnelheid = "0" Then
DuplexSnelheid = "Auto Detect"
End If
If NetwerkSnelheid = "3" Then
DuplexSnelheid = "10 Mbps/Half Duplex"
End If
If NetwerkSnelheid = "4" Then
DuplexSnelheid = "10 Mbps/Full Duplex"
End If
If NetwerkSnelheid = "5" Then
DuplexSnelheid = "100 Mbps/Half Duplex"
End If
If NetwerkSnelheid = "6" Then
DuplexSnelheid = "100 Mbps/Full Duplex"
End If
logfile.WriteLine " Netwerk snelheid voor Broadcom NetXtreme Gigabit Ethernet staat ingesteld op: " & DuplexSnelheid
Exit Sub
Case "HP NC7781 Gigabit Server Adapter"
WScript.Echo "** Controleer de netwerk instelling handmatig! **"
Exit Sub
Case "HP NC7782 Gigabit Server Adapter"
WScript.Echo "** Controleer de netwerk instelling handmatig! **"
Exit Sub
Case "Intel(R) 82540EM Based Network Connection", _
"Intel(R) 82567LF Gigabit Network Connection", _
"Intel(R) PRO/100 VE Network Connection", _
"Intel(R) PRO/100 VM Network Connection", _
"Intel(R) PRO/1000 EB Network Connection with I/O Acceleration", _
"Intel(R) PRO/1000 GT Network Connection", _
"Intel(R) PRO/1000 GT Desktop Adapter", _
"Intel(R) PRO/1000 CT Network Connection", _
"Intel(R) PRO/1000 EB Network Connection with I/O Acceleration", _
"Intel(R) PRO/1000 PL Network Connection", _
"Intel(R) PRO/1000 MT Network Connection"
NetwerkSnelheid = LeesVerbindingsSnelheid (strKeyPath & "\" & subkey, "SpeedDuplex", strComputer, strValue)
If NetwerkSnelheid = "0" Then
DuplexSnelheid = "Auto Detect"
End If
If NetwerkSnelheid = "1" Then
DuplexSnelheid = "10 Mbps/Half Duplex"
End If
If NetwerkSnelheid = "2" Then
DuplexSnelheid = "10 Mbps/Full Duplex"
End If
If NetwerkSnelheid = "3" Then
DuplexSnelheid = "100 Mbps/Half Duplex"
End If
If NetwerkSnelheid = "4" Then
DuplexSnelheid = "100 Mbps/Full Duplex"
End If
If NetwerkSnelheid = "5" Then
DuplexSnelheid = "Auto-Negotiate 1000Mbps"
End If
logfile.WriteLine " Netwerk snelheid voor Intel(R) PRO/1000 CT Network Connection staat ingesteld op: " & DuplexSnelheid
Exit Sub
Case "Marvell Yukon 88E8055 PCI-E Gigabit Ethernet Controller"
NetwerkSnelheid = LeesVerbindingsSnelheid (strKeyPath & "\" & subkey, "ConnectionType_A", strComputer, strValue)
Exit Sub
Case "NVIDIA nForce Networking Controller"
NetwerkSnelheid = LeesVerbindingsSnelheid (strKeyPath & "\" & subkey, "ForceSpeedDpx", strComputer, strValue)
Exit Sub
Case "Realtek RTL8139C+ Fast Ethernet NIC"
WScript.Echo "** Controleer de netwerk instelling handmatig! **"
Exit Sub
Case Else
blnNicFound = False
End Select
Next
If Not blnNICFound Then
WScript.Echo "Geen, of onbekende netwerkkaart gevonden op " & strComputer
End If
End If
End Sub