Contact Info

Crumbtrail » Administration » Scripts » WMI Performance Counters » VBScript

SerialPortConfiguration - WMI sample in VBScript

The foundations for Manageability in Windows 2019/2012/2008/ and Windows 10/8/7/Vista/XP are Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).

ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts has collected more than a hundred WMI samples. You can use these samples as a base for new check routines you can write yourself.

On this site, you can find many WMI samples.

The SerialPortConfiguration WMI class can be used in ActiveXperts Network Monitor to monitor your servers.



Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From Win32_SerialPortConfiguration")

For Each objItem in colItems
	WScript.Echo "AbortReadWriteOnError:" & objItem.AbortReadWriteOnError
	WScript.Echo "BaudRate:" & objItem.BaudRate
	WScript.Echo "BinaryModeEnabled:" & objItem.BinaryModeEnabled
	WScript.Echo "BitsPerByte:" & objItem.BitsPerByte
	WScript.Echo "Caption:" & objItem.Caption
	WScript.Echo "ContinueXMitOnXOff:" & objItem.ContinueXMitOnXOff
	WScript.Echo "CTSOutflowControl:" & objItem.CTSOutflowControl
	WScript.Echo "Description:" & objItem.Description
	WScript.Echo "DiscardNULLBytes:" & objItem.DiscardNULLBytes
	WScript.Echo "DSROutflowControl:" & objItem.DSROutflowControl
	WScript.Echo "DSRSensitivity:" & objItem.DSRSensitivity
	WScript.Echo "DTRFlowControlType:" & objItem.DTRFlowControlType
	WScript.Echo "EOFCharacter:" & objItem.EOFCharacter
	WScript.Echo "ErrorReplaceCharacter:" & objItem.ErrorReplaceCharacter
	WScript.Echo "ErrorReplacementEnabled:" & objItem.ErrorReplacementEnabled
	WScript.Echo "EventCharacter:" & objItem.EventCharacter
	WScript.Echo "IsBusy:" & objItem.IsBusy
	WScript.Echo "Name:" & objItem.Name
	WScript.Echo "Parity:" & objItem.Parity
	WScript.Echo "ParityCheckEnabled:" & objItem.ParityCheckEnabled
	WScript.Echo "RTSFlowControlType:" & objItem.RTSFlowControlType
	WScript.Echo "SettingID:" & objItem.SettingID
	WScript.Echo "StopBits:" & objItem.StopBits
	WScript.Echo "XOffCharacter:" & objItem.XOffCharacter
	WScript.Echo "XOffXMitThreshold:" & objItem.XOffXMitThreshold
	WScript.Echo "XOnCharacter:" & objItem.XOnCharacter
	WScript.Echo "XOnXMitThreshold:" & objItem.XOnXMitThreshold
	WScript.Echo "XOnXOffInFlowControl:" & objItem.XOnXOffInFlowControl
	WScript.Echo "XOnXOffOutFlowControl:" & objItem.XOnXOffOutFlowControl
	WScript.Echo ""
	WScript.Echo "########"
	WScript.Echo ""