+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 30
Scripts Thread, script to detect network speed in Coding and Web Development; Hi Geeks! Im looking for a script that I can run that will show me the network speed on each ...
  1. #1
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    723
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40

    script to detect network speed

    Hi Geeks!

    Im looking for a script that I can run that will show me the network speed on each pc in the domain. I would like the output to be

    ===========
    Computer 1
    ===========
    Speed = 100mbs


    ===========
    Computer 2
    ===========
    Speed = 1gbs


    etc etc.

    I have zero experience with scripts and was wondering if anyone has something like this.

    i have looked at the MS script repository and found a few examples but none of them seem to work.

    Any help would be much appreciated.

    James

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,979
    Thank Post
    3,528
    Thanked 1,107 Times in 1,014 Posts
    Rep Power
    374
    I will have a look at this later as not much time now, I think Arthur or someone will post back with a powershell script but I will look at doing this in vbs myself as still not had time to get into or my head around powershell.

    Also have you got a unc path that all machines have access to in terms of read / write so that the script can append data for each computer or each computer will create its own text file and each file will be named with the computer name ??

    for example

    computer1.txt
    computer2.txt
    etc
    Last edited by mac_shinobi; 10th March 2011 at 06:16 PM.

  3. Thanks to mac_shinobi from:

    Admiral208 (16th March 2011)

  4. #3

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    9,297
    Thank Post
    242
    Thanked 1,586 Times in 1,263 Posts
    Rep Power
    344
    BGInfo can do this or alternatively, if you use HP switches for example on the switch itself or via a web interface (if managed) will tell you the speed each port is operating at.

    If you need to know what each workstation is connecting at, I would recommend BGInfo. You can also display other information, such as the IP address, Service Pack version or even create your own custom entries.

  5. 2 Thanks to Michael:

    Admiral208 (16th March 2011), mac_shinobi (10th March 2011)

  6. #4
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    723
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    ok, thanks guys.

    i like bginfo but i dont want to have to physically go to each machine to see the speed. I would like it in a text file that I can see from my desk.

    i would like the computers to modify one text document, I dont want 100 different documetns to look through.

  7. #5

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,268
    Thank Post
    884
    Thanked 2,747 Times in 2,321 Posts
    Blog Entries
    11
    Rep Power
    785

  8. Thanks to SYNACK from:

    Admiral208 (16th March 2011)

  9. #6
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    723
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    Ok, the first script works graet but how do i combine the two??

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM MSNdis_LinkSpeed",,48)
    For Each objItem in colItems
    Wscript.Echo "InstanceName: " & objItem.InstanceName
    Wscript.Echo "NdisLinkSpeed: " & objItem.NdisLinkSpeed/10 & " kbps"
    Wscript.Echo " "
    Next
    This is what im using, how do i get it into a txt file??

  10. #7

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,762
    Thank Post
    354
    Thanked 533 Times in 498 Posts
    Rep Power
    182
    Quote Originally Posted by Admiral208 View Post
    Ok, the first script works graet but how do i combine the two??



    This is what im using, how do i get it into a txt file??
    Should be able to do it like:

    Dim Stuff, myFSO, WriteStuff, dateStamp
    dateStamp = Date()

    Stuff = ""
    Stuff2 = ""

    Set myFSO = CreateObject("Scripting.FileSystemObject")
    Set WriteStuff = myFSO.OpenTextFile("yourtextfile.txt", 8, True)

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM MSNdis_LinkSpeed",,48)
    For Each objItem in colItems
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''
    Stuff = "InstanceName: " & objItem.InstanceName
    Stuff2 = "NdisLinkSpeed: " & objItem.NdisLinkSpeed/10 & " kbps"
    WriteStuff.WriteLine(Stuff)
    WriteStuff.WriteLine(Stuff2)
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''
    Next

    WriteStuff.Close
    SET WriteStuff = NOTHING
    SET myFSO = NOTHING

    Basically just changing your echo lines to write to the file instead. Might need a little tinkering for file names etc etc :P

    Steve

  11. Thanks to Steve21 from:

    Admiral208 (16th March 2011)

  12. #8
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    723
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    thats works great, thaks steve. to take it a step further, how would i include the computer name in the results and only those network adapters that are connected instead of all the network adapters that are on my computer??

    i know im asking alot here, but it will help me.

  13. #9

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,762
    Thank Post
    354
    Thanked 533 Times in 498 Posts
    Rep Power
    182
    Assuming that first one I posted works (Can't test atm)

    Try this for Comp name:

    Dim Stuff, myFSO, WriteStuff, dateStamp
    dateStamp = Date()

    Stuff = ""
    Stuff2 = ""
    Stuff3 = ""

    Set myFSO = CreateObject("Scripting.FileSystemObject")
    Set WriteStuff = myFSO.OpenTextFile("yourtextfile.txt", 8, True)

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM MSNdis_LinkSpeed",,48)
    For Each objItem in colItems
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''
    Stuff = "InstanceName: " & objItem.InstanceName
    Stuff2 = "NdisLinkSpeed: " & objItem.NdisLinkSpeed/10 & " kbps"
    Stuff3 = "Computer Name: " & objItem.Name
    WriteStuff.WriteLine(Stuff)
    WriteStuff.WriteLine(Stuff2)
    WriteStuff.WriteLine(Stuff3)
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''
    Next

    WriteStuff.Close
    SET WriteStuff = NOTHING
    SET myFSO = NOTHING

  14. Thanks to Steve21 from:

    Admiral208 (16th March 2011)

  15. #10
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    723
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    the first post worked perfectly.

    trying this one, i get an error message

    Code:
    line: 27
    char: 21
    error: expected end of statement
    code: 800A0401

  16. #11

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,762
    Thank Post
    354
    Thanked 533 Times in 498 Posts
    Rep Power
    182
    Try:

    Dim Stuff, myFSO, WriteStuff, dateStamp
    dateStamp = Date()

    Stuff = ""
    Stuff2 = ""
    Stuff3 = ""

    Set myFSO = CreateObject("Scripting.FileSystemObject")
    Set WriteStuff = myFSO.OpenTextFile("yourtextfile.txt", 8, True)

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM MSNdis_LinkSpeed",,48)
    For Each objItem in colItems
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''
    Stuff = "InstanceName: " & objItem.InstanceName
    Stuff2 = "NdisLinkSpeed: " & objItem.NdisLinkSpeed/10 & " kbps"
    Stuff3 = "Computer Name: " & objItem.ComputerName
    WriteStuff.WriteLine(Stuff)
    WriteStuff.WriteLine(Stuff2)
    WriteStuff.WriteLine(Stuff3)
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''
    Next

    WriteStuff.Close
    SET WriteStuff = NOTHING
    SET myFSO = NOTHING
    Can't run scripts where I'm logged, so slower this way :P But try that one. Think I named "Name" wrong in first one.

  17. #12
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    723
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    error line 18: object doesnt support this property or method: 'objitem.computer name

  18. #13

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,762
    Thank Post
    354
    Thanked 533 Times in 498 Posts
    Rep Power
    182
    Quote Originally Posted by Admiral208 View Post
    error line 18: object doesnt support this property or method: 'objitem.computer name


    Silly question, but did you put a space in it?

    "'objitem.computer name " <- or is that just how it reported it

    Steve

  19. #14
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    723
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    Sorry. thats me not being able to copy text correctly.

    there is no space between computer and name

  20. #15

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,762
    Thank Post
    354
    Thanked 533 Times in 498 Posts
    Rep Power
    182
    Ah, I was being stupid.

    Dim Stuff, myFSO, WriteStuff, dateStamp
    dateStamp = Date()

    Stuff = ""
    Stuff2 = ""
    Stuff3 = ""

    Set myFSO = CreateObject("Scripting.FileSystemObject")
    Set WriteStuff = myFSO.OpenTextFile("yourtextfile.txt", 8, True)

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")


    Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

    For Each objItem in colItems
    Stuff3 = "Computer Name: " & objItem.Name
    WriteStuff.WriteLine(Stuff3)
    Next


    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")

    Set colItems = objWMIService.ExecQuery("SELECT * FROM MSNdis_LinkSpeed",,48)
    For Each objItem in colItems


    Stuff = "InstanceName: " & objItem.InstanceName
    Stuff2 = "NdisLinkSpeed: " & objItem.NdisLinkSpeed/10 & " kbps"

    WriteStuff.WriteLine(Stuff)
    WriteStuff.WriteLine(Stuff2)


    Next

    WriteStuff.Close
    SET WriteStuff = NOTHING
    SET myFSO = NOTHING
    Should work now ;P

    Only selected info from MSNdis_LinkSpeed, forgot Win32 for computer name :P

    Try that and gimme a shout,

    Steve

  21. Thanks to Steve21 from:

    Admiral208 (16th March 2011)



SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Old Server - help speed up network?
    By titch in forum Hardware
    Replies: 7
    Last Post: 19th January 2011, 12:00 PM
  2. Testing network speed
    By Ayaz in forum Windows
    Replies: 10
    Last Post: 19th November 2010, 10:24 AM
  3. Problems with Network Speed
    By Muddyfox in forum Network and Classroom Management
    Replies: 4
    Last Post: 29th April 2010, 11:41 AM
  4. Network Crawl, then sudden speed up...
    By markwilliamson2001 in forum Wireless Networks
    Replies: 2
    Last Post: 7th October 2008, 05:33 PM
  5. How to speed up a network without any uprades.
    By FN-GM in forum Wireless Networks
    Replies: 14
    Last Post: 30th January 2008, 09:11 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •