2 Replies Latest reply on Mar 20, 2007 8:57 AM by Bill Robinson

    NIC Speed and Duplex for Windows

      Anyone have a script for Windows that can pull out the Duplex and Speed of a NIC regardless of make/model of NIC? We want to make sure all our Windows Servers have there NIC settings setup correctly.

        • 1. Re: NIC Speed and Duplex for Windows

          Found the core of this script online. Google for "windows nic duplex script"

           


          On Error Resume Next

          Const HKEY_LOCAL_MACHINE = &H80000002

          strComputer = "."

          strDriverValue = "DriverDesc"
          strModeValue1 = "DuplexMode"
          strModeValue2 = "SpeedDuplex"
          strModeValue3 = "RequestedMediaType"




          strKeyPath = "System\Currentcontrolset\Control\Class\{4D36E972-E325-11CE-BFC1-08002be10318}"

          'WScript.Echo "start " & strKeyPath

          Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
          & strComputer & "\root\default:StdRegProv")

          'Obtain array of all interfaces.
          objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrayString

          For i = 0 To UBound(arrayString)
          subkey= arrayString(i)

          objReg.GetStringvalue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, strDriverValue, strValue

          objReg.GetStringvalue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, strModeValue1, dwValue1

          If dwValue1 <> "" then
          WScript.Echo subkey & "," & strValue & "," & strModeValue1 & "," & dwValue1
          '0 - Auto Detect
          '1 - 10Mbps \ Half Duplex
          '2 - 10Mbps \ Full Duplex
          '3 - 100Mbps \ Half Duplex
          '4 - 100Mbps \ Full Duplex
          End If

          objReg.GetStringvalue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, strModeValue2, dwValue2
          If dwValue2 <> "" then
          WScript.Echo subkey & "," & strValue & "," & strModeValue2 & "," & dwValue2
          End If

          objReg.GetStringvalue HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey, strModeValue3, dwValue3
          If dwValue3 <> "" then
          WScript.Echo subkey & "," & strValue & "," & strModeValue3 & "," & dwValue3
          End If
          Next

           

          • 2. Re: NIC Speed and Duplex for Windows
            Bill Robinson

            You could also do this w/ a Component Template and some Rules.

             

            The Part of the CT would be:

            HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}

             

            The Rule would say:

            HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\*\

             

            where setting is DuplexMode,SpeedDuplex and/or RequestedMediaType