Question : Need a script to find out if connected machines are running auto, full duplex 100Mbs or 10Mbs.

We have thousands of computers connected to our lan and want all of them to run at 100mbs full duplex.  This however is not the case and we often get flags that show us that there are some machines not to speed.  Is there anyway to tell which hardware is running at auto, full 100Mbs or 10Mbps on our LAN?  I read on the internet a few months ago about a script written that could detect this.  Any help would be greatly appreciated.

Answer : Need a script to find out if connected machines are running auto, full duplex 100Mbs or 10Mbs.

OK...  I was kinda hoping you'd be able to tell me if it was returning good information or not, before we got this far.  No matter.

Here is a complete script to test your entire network....  Just copy and paste this into a text file, rename the text file with a ".vbs" extention.  You must be logged in as a Domain Administrator to run this script.

There are two places in the script that will require editing... one is the name of the log file... and second is the name of your domain.

<---------------------- cut here ------------------>
Dim objs, obj
Dim wsh, Cmd, i, buf, ComputerName
dim fso, ts

' create a log file for the output
set fso = createobject("Scripting.FileSystemObject")
set ts = fso.OpenTextFile("c:\LinkSpeed_Log.txt", 2)  ' change to suit your needs

' execute the "Net View" command
Set wsh = CreateObject("WScript.Shell")
set Cmd = wsh.Exec("Net View /Domain:DOMAIN_NAME")    ' chage with your domain name
wscript.sleep 100

' read the output and parse the computer names
do while Not Cmd.StdOut.AtEndOfStream
      buf = cmd.stdout.readline
      if left(buf, 2) = "\\" then
            i = instr(buf, " ")
            ComputerName = mid(buf, 3, i-3)
                  DoIt computername
            end if
      end if
loop

ts.close()
msgbox("Done")

sub DoIt(computername)
      ' ignore errors ("RPC Server not available" = PC is turned off)
      on error resume next
      Set objs = GetObject("winmgmts:\\.\root\wmi").InstancesOf("MSNdis_LinkSpeed")
      for each obj in objs
            if obj.Active = true and left(obj.InstanceName, 4) <> "WAN " and right(obj.InstanceName, 8) <> "Miniport" then
                  ' record the answer in our log file
                  ts.writeline(ComputerName & ", " & obj.InstanceName & ", " & obj.NdisLinkSpeed / 10000)
            end if
      next
      on error goto 0
end sub
Random Solutions  
 
programming4us programming4us