Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Network Driver/Duplex

Status
Not open for further replies.

twooly

MIS
Feb 22, 2004
122
US
Does anyone have any ideas on how to get the Network Driver and Duplex from all Network Cards on a NT4 box? I got it figured out for w2k/w2k3 but nt4 of course is way different.

Thanks for the suggestions.

--Todd
 
I am actually just reading the registry for the others. I just can't find where NT stores the info.
 
I would like to see you script for w2k and w2k3. If you don't mind will you post it.

Thanks
 
I have it integrated into an excel sheet but this should help you

Sub GetNetworkDriverData()
On Error Resume Next

vResultsRow = 1 ' Row to start recording data on

Application.ScreenUpdating = False

Sheets("ServerList").Select
sServer = ActiveCell.EntireRow.Columns("A").Value 'Server to check

Sheets("Results").Select ' Jump to first blank spot on Results sheet
Do Until Cells(vResultsRow, 1).Value = ""
vResultsRow = vResultsRow + 1
Loop

Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1

Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & sServer & "\root\default:StdRegProv")
strMasterKeyPath = "SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}"
objReg.EnumKey HKEY_LOCAL_MACHINE, strMasterKeyPath, arrSubKeys 'Get all the subkey values

For Each SubKey In arrSubKeys
strKeyPath = "SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\" & SubKey
objReg.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames, arrValueTypes 'Get all Values in that subkey
If Not IsArray(arrEntryNames) Then
vResultsRow = vResultsRow - 1
'do nothing and go to the next subkey
Else
For i = 0 To UBound(arrEntryNames) 'For each value in the array of Values check the type and output it
Select Case arrEntryNames(i)
Case "DriverDate"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Cells(vResultsRow, 4).Value = strValue
Cells(vResultsRow, 1).Value = sServer
Case "DriverVersion"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Cells(vResultsRow, 3).Value = strValue
Cells(vResultsRow, 1).Value = sServer
Case "DriverDesc"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Cells(vResultsRow, 2).Value = strValue
Cells(vResultsRow, 1).Value = sServer
Case "SpeedDuplex"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Select Case strValue
Case 0
Cells(vResultsRow, 5).Value = "Auto Detect"
Cells(vResultsRow, 1).Value = sServer
Case 1
Cells(vResultsRow, 5).Value = "10Mbps/Half Duplex"
Cells(vResultsRow, 1).Value = sServer
Case 2
Cells(vResultsRow, 5).Value = "10Mbps/Full Duplex"
Cells(vResultsRow, 1).Value = sServer
Case 3
Cells(vResultsRow, 5).Value = "100Mbps/Half Duplex"
Cells(vResultsRow, 1).Value = sServer
Case 4
Cells(vResultsRow, 5).Value = "100Mbps/Full Duplex"
Cells(vResultsRow, 1).Value = sServer
End Select
Case "RequestedMediaType"
objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, arrEntryNames(i), strValue
Select Case strValue
Case 0
Cells(vResultsRow, 5).Value = "Auto Detect"
Cells(vResultsRow, 1).Value = sServer
Case 3
Cells(vResultsRow, 5).Value = "10Mbps/Half Duplex"
Cells(vResultsRow, 1).Value = sServer
Case 4
Cells(vResultsRow, 5).Value = "10Mbps/Full Duplex"
Cells(vResultsRow, 1).Value = sServer
Case 5
Cells(vResultsRow, 5).Value = "100Mbps/Half Duplex"
Cells(vResultsRow, 1).Value = sServer
Case 6
Cells(vResultsRow, 5).Value = "100Mbps/Full Duplex"
Cells(vResultsRow, 1).Value = sServer
End Select
End Select
Next
If Cells(vResultsRow, 2).Value = "RAS Async Adapter" Then
Cells(vResultsRow, 2).EntireRow.Delete
vResultsRow = vResultsRow - 1
ElseIf Cells(vResultsRow, 2).Value = "WAN Miniport (L2TP)" Then
Cells(vResultsRow, 2).EntireRow.Delete
vResultsRow = vResultsRow - 1
ElseIf Cells(vResultsRow, 2).Value = "WAN Miniport (PPTP)" Then
Cells(vResultsRow, 2).EntireRow.Delete
vResultsRow = vResultsRow - 1
ElseIf Cells(vResultsRow, 2).Value = "Direct Parallel" Then
Cells(vResultsRow, 2).EntireRow.Delete
vResultsRow = vResultsRow - 1
ElseIf Cells(vResultsRow, 2).Value = "WAN Miniport (IP)" Then
Cells(vResultsRow, 2).EntireRow.Delete
vResultsRow = vResultsRow - 1
ElseIf Cells(vResultsRow, 2).Value = "WAN Miniport (IPX)" Then
Cells(vResultsRow, 2).EntireRow.Delete
vResultsRow = vResultsRow - 1
End If
End If
vResultsRow = vResultsRow + 1
Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top