Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » Adsi

Monitor Remote Access RAS Port Performance in Windows

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.

Monitor Remote Access RAS Port Performance in Windows using VBScript, WMI and LDAP

Example(s)

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
set objRefresher = CreateObject("WbemScripting.SWbemRefresher")
Set colItems = objRefresher.AddEnum(objWMIService," & _
    "Win32_PerfFormattedData_PerfProc_RemoteAccess_RASPort").objectSet
objRefresher.Refresh

For i = 1 to 5
    For Each objItem in colItems
        Wscript.Echo "Alignment Errors: " & objItem.AlignmentErrors
        Wscript.Echo "Buffer Overrun Errors: " & objItem.BufferOverrunErrors
        Wscript.Echo "Bytes Received: " & objItem.BytesReceived
        Wscript.Echo "Bytes Received Per Second: " & _
            objItem.BytesReceivedPerSec
        Wscript.Echo "Bytes Transmitted: " & objItem.BytesTransmitted
        Wscript.Echo "Bytes Transmitted Per Second: " & _
            objItem.BytesTransmittedPerSec
        Wscript.Echo "Caption: " & objItem.Caption
        Wscript.Echo "CRC Errors: " & objItem.CRCErrors
        Wscript.Echo "Description: " & objItem.Description
        Wscript.Echo "Frames Received: " & objItem.FramesReceived
        Wscript.Echo "Frames Received Per Second: " & _
            objItem.FramesReceivedPerSec
        Wscript.Echo "Frames Transmitted: " & objItem.FramesTransmitted
        Wscript.Echo "Frames Transmitted Per Second: " & _
            objItem.FramesTransmittedPerSec
        Wscript.Echo "Name: " & objItem.Name
        Wscript.Echo "Percent Compression In: " & objItem.PercentCompressionIn
        Wscript.Echo "Percent Compression Out: " & _
            objItem.PercentCompressionOut
        Wscript.Echo "Serial Overrun Errors: " & objItem.SerialOverrunErrors
        Wscript.Echo "Timeout Errors: " & objItem.TimeoutErrors
        Wscript.Echo "Total Errors: " & objItem.TotalErrors
        Wscript.Echo "Total Errors Per Second: " & objItem.TotalErrorsPerSec
        Wscript.Sleep 2000
        objRefresher.Refresh
    Next
Next