Win32_PnPDeviceProperty

Win32 Pn PDevice Property
root/cimv2abstract

The base type for classes representing a property returned by the Win32_PnPEntity::GetDeviceProperties Method.

On this page

Main example

List instances

# Abstract class: Get-CimInstance returns the instances of its subclasses
Get-CimInstance -ClassName Win32_PnPDeviceProperty |
    Select-Object -Property DeviceID, Key, KeyName, Type

Abstract class: it has no instances of its own. Get-CimInstance returns the instances of its subclasses (Win32_PnPDevicePropertyBinary, Win32_PnPDevicePropertyBoolean, Win32_PnPDevicePropertyBooleanArray, Win32_PnPDevicePropertyDateTime, …).

Examples

Decode numeric values

# Lookup table for Type (values documented by Microsoft)
$typeName = @{
    0 = 'Empty'
    1 = 'Null'
    2 = 'SByte'
    3 = 'Byte'
    4 = 'Int16'
    5 = 'UInt16'
    6 = 'Int32'
    7 = 'Uint32'
    8 = 'Int64'
    9 = 'UInt64'
    10 = 'Float'
    11 = 'Double'
    12 = 'Decimal'
    13 = 'Guid'
    14 = 'Currency'
    15 = 'Date'
    16 = 'FileTime'
    17 = 'Boolean'
    18 = 'String'
    19 = 'SecurityDescriptor'
    20 = 'SecurityDescriptorString'
    21 = 'DEVPROPKEY'
    22 = 'DEVPROPTYPE'
    23 = 'Error'
    24 = 'NTStatus'
    25 = 'StringIndirect'
    4098 = 'SByteArray'
    4099 = 'Binary'
    4100 = 'Int16Array'
    4101 = 'UInt16Array'
    4102 = 'Int64Array'
    4103 = 'UInt64Array'
    4104 = 'FloatArray'
    4105 = 'DoubleArray'
    4106 = 'DecimalArray'
    4107 = 'GuidArray'
    4108 = 'CurrencyArray'
    4109 = 'DateArray'
    4110 = 'FileTimeArray'
    4111 = 'BooleanArray'
    4112 = 'StringList'
    4113 = 'SecurityDescriptorList'
    4117 = 'ErrorArray'
    4118 = 'NTStatusArray'
    4119 = 'StringIndirectList'
    4120 = 'Unknown - check in devpropdef.h'
    8210 = 'SecurityDescriptorStringList'
    8211 = 'DEVPROPKEYArray'
    8212 = 'DEVPROPTYPEArray'
    8217 = 'TBD'
}

Get-CimInstance -ClassName Win32_PnPDeviceProperty |
    Select-Object -Property @(
        'DeviceID'
        'Key'
        'KeyName'
        @{ Name = 'Type'; Expression = { $typeName[[int]$_.Type] } }
    )

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_PnPDeviceProperty |
        Select-Object -Property DeviceID, Key, KeyName, Type
} 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_PnPDeviceProperty
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

4 of 4 properties
NameTypeAccessDescription
DeviceIDstringread

Identifies the PnP device.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of DeviceID for each instance
Get-CimInstance -ClassName Win32_PnPDeviceProperty -Property DeviceID |
    Select-Object -Property DeviceID
Keystringread

The value of the Key Name-Value pair that identifies the Data property.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Key for each instance
Get-CimInstance -ClassName Win32_PnPDeviceProperty -Property Key |
    Select-Object -Property Key
KeyNamestringread

The name of the Key Name-Value pair that identifies the Data property.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of KeyName for each instance
Get-CimInstance -ClassName Win32_PnPDeviceProperty -Property KeyName |
    Select-Object -Property KeyName
Typeuint32read

The type of the Data property.

The possible values are.

Values (52)
ValueLabelDescription
0Empty
1Null
2SByte
3Byte
4Int16
5UInt16
6Int32
7Uint32
8Int64
9UInt64
10Float
11Double
12Decimal
13Guid
14Currency
15Date
16FileTime
17Boolean
18String
19SecurityDescriptor
20SecurityDescriptorString
21DEVPROPKEY
22DEVPROPTYPE
23Error
24NTStatus
25StringIndirect
26..4097Reserved
4098SByteArray
4099Binary
4100Int16Array
4101UInt16Array
4102Int64Array
4103UInt64Array
4104FloatArray
4105DoubleArray
4106DecimalArray
4107GuidArray
4108CurrencyArray
4109DateArray
4110FileTimeArray
4111BooleanArray
4112StringList
4113SecurityDescriptorList
8210SecurityDescriptorStringList
8211DEVPROPKEYArray
8212DEVPROPTYPEArray
4117ErrorArray
4118NTStatusArray
4119StringIndirectList
4120Unknown - check in devpropdef.h
8217TBD
8218..4294967295Reserved
Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Type for each instance
# Lookup table for Type (values documented by Microsoft)
$typeName = @{
    0 = 'Empty'
    1 = 'Null'
    2 = 'SByte'
    3 = 'Byte'
    4 = 'Int16'
    5 = 'UInt16'
    6 = 'Int32'
    7 = 'Uint32'
    8 = 'Int64'
    9 = 'UInt64'
    10 = 'Float'
    11 = 'Double'
    12 = 'Decimal'
    13 = 'Guid'
    14 = 'Currency'
    15 = 'Date'
    16 = 'FileTime'
    17 = 'Boolean'
    18 = 'String'
    19 = 'SecurityDescriptor'
    20 = 'SecurityDescriptorString'
    21 = 'DEVPROPKEY'
    22 = 'DEVPROPTYPE'
    23 = 'Error'
    24 = 'NTStatus'
    25 = 'StringIndirect'
    4098 = 'SByteArray'
    4099 = 'Binary'
    4100 = 'Int16Array'
    4101 = 'UInt16Array'
    4102 = 'Int64Array'
    4103 = 'UInt64Array'
    4104 = 'FloatArray'
    4105 = 'DoubleArray'
    4106 = 'DecimalArray'
    4107 = 'GuidArray'
    4108 = 'CurrencyArray'
    4109 = 'DateArray'
    4110 = 'FileTimeArray'
    4111 = 'BooleanArray'
    4112 = 'StringList'
    4113 = 'SecurityDescriptorList'
    4117 = 'ErrorArray'
    4118 = 'NTStatusArray'
    4119 = 'StringIndirectList'
    4120 = 'Unknown - check in devpropdef.h'
    8210 = 'SecurityDescriptorStringList'
    8211 = 'DEVPROPKEYArray'
    8212 = 'DEVPROPTYPEArray'
    8217 = 'TBD'
}
Get-CimInstance -ClassName Win32_PnPDeviceProperty -Property Type |
    Select-Object -Property @(
        @{ Name = 'Type'; Expression = { $typeName[[int]$_.Type] } }
    )

Inheritance

Superclass chain

This class has no superclass.

Known subclasses

Requirements

Namespace
root/cimv2
Minimum client
Windows 10 [desktop apps only]
Minimum server
Windows Server 2016
MOF file
Cimwin32.mof
DLL
CIMWin32.dll
Class qualifiers

abstract UUID("{ee0b76cd-314b-41f1-99d4-d4f3b0421430}") 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.