Win32_SerialPortConfiguration

Win32 Serial Port Configuration
root/cimv2dynamickey : Name

The Win32_SerialPortConfiguration WMI class represents the settings for data transmission on a Windows-based serial port. This includes configurations for establishing a connection and error checking.

On this page

Main example

List instances

# All instances of Win32_SerialPortConfiguration, with the main properties
Get-CimInstance -ClassName Win32_SerialPortConfiguration |
    Select-Object -Property Name, Description, AbortReadWriteOnError, BaudRate

Examples

Filter with WQL

# WQL filter evaluated by the provider: XOnXOffInFlowControl = 1 (TRUE)
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Filter 'XOnXOffInFlowControl = 1' |
    Select-Object -Property Name, Description, AbortReadWriteOnError, BaudRate

The filter is evaluated by the WMI provider: less data is transferred than with Where-Object.

Decode numeric values

# Lookup table for XOnXOffInFlowControl (values documented by Microsoft)
$xOnXOffInFlowControlName = @{
    0 = 'FALSE'
    1 = 'TRUE'
}

Get-CimInstance -ClassName Win32_SerialPortConfiguration |
    Select-Object -Property @(
        'Name'
        'Description'
        'AbortReadWriteOnError'
        'BaudRate'
        @{ Name = 'XOnXOffInFlowControl'; Expression = { $xOnXOffInFlowControlName[[int]$_.XOnXOffInFlowControl] } }
    )

Query a remote computer (CIM session)

review before running
# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
    Get-CimInstance -CimSession $cimSession -ClassName Win32_SerialPortConfiguration |
        Select-Object -Property Name, Description, AbortReadWriteOnError, BaudRate
} finally {
    Remove-CimSession -CimSession $cimSession
}

WSMan (WinRM) is used by default. For a host without WinRM, create the session with -SessionOption (New-CimSessionOption -Protocol Dcom). Add -Credential to use another account.

Show the class structure

# Class structure: properties, types and flags (Key, ReadOnly…)
$cimClass = Get-CimClass -ClassName Win32_SerialPortConfiguration
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

29 of 29 properties
NameTypeAccessDescription
AbortReadWriteOnErrorbooleanread

If TRUE, read and write operations are terminated if an error occurs. If TRUE, the driver terminates all read and write operations with an error status if an error occurs. The driver will not accept any further communications operations until the application acknowledges the error.

Code
# Value of AbortReadWriteOnError for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, AbortReadWriteOnError |
    Select-Object -Property Name, AbortReadWriteOnError
BaudRateuint32read

Baud (bits per second) rate at which the communications device operates.

Example: 9600

Code
# Value of BaudRate for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, BaudRate |
    Select-Object -Property Name, BaudRate
BinaryModeEnabledbooleanread

If TRUE, binary-mode data transfers are enabled for the serial port. Computer systems running Windows only allow binary transfers through serial ports, so this value is always TRUE.

Code
# Value of BinaryModeEnabled for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, BinaryModeEnabled |
    Select-Object -Property Name, BinaryModeEnabled
BitsPerByteuint32read

Number of bits transmitted and received for each byte of data for the Windows serial port. The number may vary with control and error correction bits, such as parity bits.

Example: 8

Code
# Value of BitsPerByte for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, BitsPerByte |
    Select-Object -Property Name, BitsPerByte
Captionstringread

Short textual description of the current object.

Code
# Value of Caption for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, Caption |
    Select-Object -Property Name, Caption
ContinueXMitOnXOffbooleanread

If TRUE, data transmissions continue when the input buffer has come within XOffXMitThreshold bytes of being full and the driver has transmitted the XOffChararcter value to stop receiving bytes. If FALSE, transmission does not continue until the input buffer is within XOnXMitThreshold bytes of being empty and the driver has transmitted the XOnCharacter value to resume reception.

Code
# Value of ContinueXMitOnXOff for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, ContinueXMitOnXOff |
    Select-Object -Property Name, ContinueXMitOnXOff
CTSOutflowControlbooleanread

If TRUE, the clear to send (CTS) signal is checked before transmitting data. CTS signals that both devices on the serial connection are ready to transfer data. Data transmission is suspended until the CTS signal is given.

Code
# Value of CTSOutflowControl for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, CTSOutflowControl |
    Select-Object -Property Name, CTSOutflowControl
Descriptionstringread

Textual description of the current object.

Code
# Value of Description for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, Description |
    Select-Object -Property Name, Description
DiscardNULLBytesbooleanread

If TRUE, NULL bytes (characters) are discarded when they are received.

Code
# Value of DiscardNULLBytes for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, DiscardNULLBytes |
    Select-Object -Property Name, DiscardNULLBytes
DSROutflowControlbooleanread

If TRUE, data outflow control is enabled when there is a data set ready (DSR) condition. DSR signals that the connection has been established by the devices on the serial connection. DSR data transmission is suspended until the DSR signal is given.

Code
# Value of DSROutflowControl for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, DSROutflowControl |
    Select-Object -Property Name, DSROutflowControl
DSRSensitivitybooleanread

If TRUE, the communications driver is sensitive to the state of the DSR signal. The driver ignores any bytes received, unless the DSR modem input line is high.

Code
# Value of DSRSensitivity for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, DSRSensitivity |
    Select-Object -Property Name, DSRSensitivity
DTRFlowControlTypestringread

Use of the data terminal ready (DTR) flow control after a connection has been established.

Values (3)
ValueLabelDescription
EnableEnable
DisableDisable
HandshakeHandshake
Code
# Value of DTRFlowControlType for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, DTRFlowControlType |
    Select-Object -Property Name, DTRFlowControlType
EOFCharacteruint32read

Value of the character used to signal the end of data.

Example: ^Z

Code
# Value of EOFCharacter for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, EOFCharacter |
    Select-Object -Property Name, EOFCharacter
ErrorReplaceCharacteruint32read

Value of the character used to replace bytes received with a parity error.

Example: ^C

Code
# Value of ErrorReplaceCharacter for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, ErrorReplaceCharacter |
    Select-Object -Property Name, ErrorReplaceCharacter
ErrorReplacementEnabledbooleanread

If TRUE, bytes received with parity errors are replaced with the ErrorReplaceCharacter value. Characters with parity errors are only replaced if this property is TRUE and the parity is enabled.

Code
# Value of ErrorReplacementEnabled for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, ErrorReplacementEnabled |
    Select-Object -Property Name, ErrorReplacementEnabled
EventCharacteruint32read

Value of the control character that is used to signal an event, such as end of file.

Example: ^e

Code
# Value of EventCharacter for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, EventCharacter |
    Select-Object -Property Name, EventCharacter
IsBusybooleanread

If TRUE, the serial port is busy.

Code
# Value of IsBusy for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, IsBusy |
    Select-Object -Property Name, IsBusy
Name keystringread

Name of the Windows serial port.

Example: "COM1"

Code
# Value of Name for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name |
    Select-Object -Property Name
Paritystringread

Method of parity checking to be used. Parity is used as an error checking technique where an extra parity bit is included with every unit of data. The receiver can then verify the validity of the data by counting the bits that are set.

Values (5)
ValueLabelDescription
NoneNoneParity checking not used.
OddOddSets the parity bit so that the count of bits set is an odd number.
EvenEvenSets the parity bit so that the count of bits set is an even number.
MarkMarkLeaves the parity bit set to 1.
SpaceSpaceLeaves the parity bit set to 0 (zero).
Code
# Value of Parity for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, Parity |
    Select-Object -Property Name, Parity
ParityCheckEnabledbooleanread

If TRUE, parity checking is enabled.

Code
# Value of ParityCheckEnabled for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, ParityCheckEnabled |
    Select-Object -Property Name, ParityCheckEnabled
RTSFlowControlTypestringread

Request to send (RTS) flow control. RTS is used to signal that data is available for transmission.

Values (4)
ValueLabelDescription
EnableEnableRTS is left on for the data transfer session.
DisableDisableRTS is ignored after the first RTS signal is received.
HandshakeHandshakeRTS is turned off if the transmission buffer is more than three-quarters full, and RTS is turned on when the buffer is less than one-half full.
ToggleToggleRTS is turned on if there is any data buffered for transmission.
Code
# Value of RTSFlowControlType for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, RTSFlowControlType |
    Select-Object -Property Name, RTSFlowControlType
SettingIDstringread

Identifier by which the current object is known.

Code
# Value of SettingID for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, SettingID |
    Select-Object -Property Name, SettingID
StopBitsstringread

Number of stop bits to be used. Stop bits separate each unit of data on an asynchronous serial connection. They are also sent continuously when no data is available for transmission.

Values (3)
ValueLabelDescription
11
1.51.5
22
Code
# Value of StopBits for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, StopBits |
    Select-Object -Property Name, StopBits
XOffCharacteruint32read

Value of the XOFF character for both transmission and reception. XOFF is a software control to stop the transmission of data (whereas RTS and CTS are hardware controls). XON resumes the transmission.

Code
# Value of XOffCharacter for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, XOffCharacter |
    Select-Object -Property Name, XOffCharacter
XOffXMitThresholduint32read

Maximum number of bytes allowed in the input buffer before the XOFF character is sent.

Code
# Value of XOffXMitThreshold for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, XOffXMitThreshold |
    Select-Object -Property Name, XOffXMitThreshold
XOnCharacteruint32read

Value of the XON character for both transmission and reception. XON is a software control to resume the transmission of data (whereas RTS and CTS are hardware controls). XOFF stops the transmission.

Code
# Value of XOnCharacter for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, XOnCharacter |
    Select-Object -Property Name, XOnCharacter
XOnXMitThresholduint32read

Minimum number of bytes allowed in the input buffer before the XON character is sent. This property works in conjunction with XOffXMitThreshold to regulate the rate at which data is transferred.

Code
# Value of XOnXMitThreshold for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, XOnXMitThreshold |
    Select-Object -Property Name, XOnXMitThreshold
XOnXOffInFlowControluint32read

If TRUE, XON/XOFF flow control is used during reception. If TRUE, the XOffCharacter value is sent when the input buffer comes within XOffXMitThreshold bytes of being full, and the XOnCharacter value is sent when the input buffer comes within XOnXMitThreshold bytes of being empty.

Values (2)
ValueLabelDescription
0FALSE
1TRUE
Code
# Value of XOnXOffInFlowControl for each instance
# Lookup table for XOnXOffInFlowControl (values documented by Microsoft)
$xOnXOffInFlowControlName = @{
    0 = 'FALSE'
    1 = 'TRUE'
}
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, XOnXOffInFlowControl |
    Select-Object -Property @(
        'Name'
        @{ Name = 'XOnXOffInFlowControl'; Expression = { $xOnXOffInFlowControlName[[int]$_.XOnXOffInFlowControl] } }
    )
XOnXOffOutFlowControluint32read

The XOnXOffOutFlowControl specifies whether XON or XOFF flow control is used during transmission. If TRUE, transmission stops when the XOffCharacter value is received and starts again when the XOnCharacter value is received.

Code
# Value of XOnXOffOutFlowControl for each instance
Get-CimInstance -ClassName Win32_SerialPortConfiguration -Property Name, XOnXOffOutFlowControl |
    Select-Object -Property Name, XOnXOffOutFlowControl

Remarks

The Win32_SerialPortConfiguration class is derived from CIM_Setting.

Inheritance

Superclass chain

  1. CIM_Setting
  2. Win32_SerialPortConfiguration

Known subclasses

No known subclass.

Requirements

Namespace
root/cimv2
Minimum client
Windows Vista
Minimum server
Windows Server 2008
Provider
CIMWin32
MOF file
CIMWin32.mof
DLL
CIMWin32.dll
Class qualifiers

Dynamic Provider("CIMWin32") UUID("{8502C4EB-5FBB-11D2-AAC1-006008C78BC7}") AMENDMENT

Microsoft source

Source: Microsoft Learn

Descriptions, properties and methods come from the Microsoft documentation (MicrosoftDocs/win32 repository), published under the CC BY 4.0 licence. Formatting and translations are specific to this site; the PowerShell examples are written for it.