Win32_CDROMDrive

Win32 CDROMDrive
root/cimv2dynamickey : DeviceID

Represents a CD-ROM drive on a computer system running Windows.

On this page

Main example

List instances

# All instances of Win32_CDROMDrive, with the main properties
Get-CimInstance -ClassName Win32_CDROMDrive |
    Select-Object -Property @(
        'DeviceID'
        'Description'
        'Status'
        'Manufacturer'
        'SerialNumber'
        'VolumeName'
        @{ Name = 'SizeGB'; Expression = { [math]::Round($_.Size / 1GB, 2) } }
    )

Examples

Filter with WQL

# WQL filter evaluated by the provider: Availability = 3 (Running/Full Power)
Get-CimInstance -ClassName Win32_CDROMDrive -Filter 'Availability = 3' |
    Select-Object -Property @(
        'DeviceID'
        'Description'
        'Status'
        'Manufacturer'
        'SerialNumber'
        'VolumeName'
        @{ Name = 'SizeGB'; Expression = { [math]::Round($_.Size / 1GB, 2) } }
    )

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

Decode numeric values

# Lookup table for Availability (values documented by Microsoft)
$availabilityName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Running/Full Power'
    4 = 'Warning'
    5 = 'In Test'
    6 = 'Not Applicable'
    7 = 'Power Off'
    8 = 'Off Line'
    9 = 'Off Duty'
    10 = 'Degraded'
    11 = 'Not Installed'
    12 = 'Install Error'
    13 = 'Power Save - Unknown'
    14 = 'Power Save - Low Power Mode'
    15 = 'Power Save - Standby'
    16 = 'Power Cycle'
    17 = 'Power Save - Warning'
    18 = 'Paused'
    19 = 'Not Ready'
    20 = 'Not Configured'
    21 = 'Quiesced'
}
# Lookup table for ConfigManagerErrorCode (values documented by Microsoft)
$configManagerErrorCodeName = @{
    0 = 'This device is working properly'
    1 = 'This device is not configured correctly'
    2 = 'Windows cannot load the driver for this device'
    3 = 'The driver for this device might be corrupted, or your…'
    4 = 'This device is not working properly'
    5 = 'The driver for this device needs a resource that Windows…'
    6 = 'The boot configuration for this device conflicts with other…'
    7 = 'Cannot filter'
    8 = 'The driver loader for the device is missing'
    9 = 'This device is not working properly because the controlling…'
    10 = 'This device cannot start'
    11 = 'This device failed'
    12 = 'This device cannot find enough free resources that it can use'
    13 = 'Windows cannot verify this device''s resources'
    14 = 'This device cannot work properly until you restart your…'
    15 = 'This device is not working properly because there is…'
    16 = 'Windows cannot identify all the resources this device uses'
    17 = 'This device is asking for an unknown resource type'
    18 = 'Reinstall the drivers for this device'
    19 = 'Failure using the VxD loader'
    20 = 'Your registry might be corrupted'
    21 = 'System failure: Try changing the driver for this device'
    22 = 'This device is disabled'
    23 = 'System failure: Try changing the driver for this device'
    24 = 'This device is not present, is not working properly, or does…'
    25 = 'Windows is still setting up this device'
    26 = 'Windows is still setting up this device'
    27 = 'This device does not have valid log configuration'
    28 = 'The drivers for this device are not installed'
    29 = 'This device is disabled because the firmware of the device…'
    30 = 'This device is using an Interrupt Request (IRQ) resource…'
    31 = 'This device is not working properly because Windows cannot…'
}

Get-CimInstance -ClassName Win32_CDROMDrive |
    Select-Object -Property @(
        'DeviceID'
        'Description'
        'Status'
        'Manufacturer'
        'SerialNumber'
        'VolumeName'
        @{ Name = 'SizeGB'; Expression = { [math]::Round($_.Size / 1GB, 2) } }
    )

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_CDROMDrive |
        Select-Object -Property @(
            'DeviceID'
            'Description'
            'Status'
            'Manufacturer'
            'SerialNumber'
            'VolumeName'
            @{ Name = 'SizeGB'; Expression = { [math]::Round($_.Size / 1GB, 2) } }
        )
} 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_CDROMDrive
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

49 of 49 properties
NameTypeAccessDescription
Availabilityuint16read

Availability and status of the device.

Values (21)
ValueLabelDescription
1Other
2Unknown
3Running/Full PowerRunning or Full Power
4Warning
5In Test
6Not Applicable
7Power Off
8Off Line
9Off Duty
10Degraded
11Not Installed
12Install Error
13Power Save - UnknownThe device is known to be in a power save mode, but its exact status is unknown.
14Power Save - Low Power ModeThe device is in a power save state but still functioning, and may exhibit degraded performance.
15Power Save - StandbyThe device is not functioning, but could be brought to full power quickly.
16Power Cycle
17Power Save - WarningThe device is in a warning state, though also in a power save mode.
18PausedThe device is paused.
19Not ReadyThe device is not ready.
20Not ConfiguredThe device is not configured.
21QuiescedThe device is quiet.
Code
# Value of Availability for each instance
# Lookup table for Availability (values documented by Microsoft)
$availabilityName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Running/Full Power'
    4 = 'Warning'
    5 = 'In Test'
    6 = 'Not Applicable'
    7 = 'Power Off'
    8 = 'Off Line'
    9 = 'Off Duty'
    10 = 'Degraded'
    11 = 'Not Installed'
    12 = 'Install Error'
    13 = 'Power Save - Unknown'
    14 = 'Power Save - Low Power Mode'
    15 = 'Power Save - Standby'
    16 = 'Power Cycle'
    17 = 'Power Save - Warning'
    18 = 'Paused'
    19 = 'Not Ready'
    20 = 'Not Configured'
    21 = 'Quiesced'
}
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, Availability |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'Availability'; Expression = { $availabilityName[[int]$_.Availability] } }
    )
Capabilitiesuint16[]read

Array of capabilities of the media access device. For example, the device may support random access (3), removable media (7), and automatic cleaning (9).

Values (13)
ValueLabelDescription
0Unknown
1Other
2Sequential Access
3Random Access
4Supports Writing
5Encryption
6Compression
7Supports Removeable MediaSupports Removable Media
8Manual Cleaning
9Automatic Cleaning
10SMART Notification
11Supports Dual Sided MediaSupports Dual-Sided Media
12Predismount Eject Not Required
Code
# Value of Capabilities for each instance
# Lookup table for Capabilities (values documented by Microsoft)
$capabilitiesName = @{
    0 = 'Unknown'
    1 = 'Other'
    2 = 'Sequential Access'
    3 = 'Random Access'
    4 = 'Supports Writing'
    5 = 'Encryption'
    6 = 'Compression'
    7 = 'Supports Removeable Media'
    8 = 'Manual Cleaning'
    9 = 'Automatic Cleaning'
    10 = 'SMART Notification'
    11 = 'Supports Dual Sided Media'
    12 = 'Predismount Eject Not Required'
}
# Capabilities is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_CDROMDrive -Property Capabilities |
    Select-Object -ExpandProperty Capabilities |
    ForEach-Object -Process { $capabilitiesName[[int]$_] }
CapabilityDescriptionsstring[]read

Array of more detailed explanations for any of the access device features indicated in the Capabilities array. Each entry of this array is related to the entry in the Capabilities array that is located at the same index.

Code
# Value of CapabilityDescriptions for each instance
# CapabilityDescriptions is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_CDROMDrive -Property CapabilityDescriptions |
    Select-Object -ExpandProperty CapabilityDescriptions
Captionstringread

Short description of the object a one-line string.

Code
# Value of Caption for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, Caption |
    Select-Object -Property DeviceID, Caption
CompressionMethodstringread

Algorithm or tool used by the device to support compression. If it is not possible or not desired to describe the compression scheme (perhaps because it is not known), use the following words: "Unknown" to represent that it is not known whether the device supports compression capabilities; "Compressed" to represent that the device supports compression capabilities but either its compression scheme is not known or not disclosed; and "Not Compressed" to represent that the device does not support compression capabilities.

Values (3)
ValueLabelDescription
UnknownUnknownThe compression scheme is unknown or not described.
CompressedCompressedThe logical file is compressed, but the compression scheme is unknown or not described
Not CompressedNot CompressedIf the logical file is not compressed
Code
# Value of CompressionMethod for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, CompressionMethod |
    Select-Object -Property DeviceID, CompressionMethod
ConfigManagerErrorCodeuint32read

Windows Configuration Manager error code.

Values (32)
ValueLabelDescription
0This device is working properly.Device is working properly.
1This device is not configured correctly.Device is not configured correctly.
2Windows cannot load the driver for this device.
3The driver for this device might be corrupted, or your system may be running low on memory or other resources.Driver for this device might be corrupted, or the system may be low on memory or other resources.
4This device is not working properly. One of its drivers or your registry might be corrupted.Device is not working properly. One of its drivers or the registry might be corrupted.
5The driver for this device needs a resource that Windows cannot manage.Driver for the device requires a resource that Windows cannot manage.
6The boot configuration for this device conflicts with other devices.Boot configuration for the device conflicts with other devices.
7Cannot filter.
8The driver loader for the device is missing.Driver loader for the device is missing.
9This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly.Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.
10This device cannot start.Device cannot start.
11This device failed.Device failed.
12This device cannot find enough free resources that it can use.Device cannot find enough free resources to use.
13Windows cannot verify this device's resources.Windows cannot verify the device's resources.
14This device cannot work properly until you restart your computer.Device cannot work properly until the computer is restarted.
15This device is not working properly because there is probably a re-enumeration problem.Device is not working properly due to a possible re-enumeration problem.
16Windows cannot identify all the resources this device uses.Windows cannot identify all of the resources that the device uses.
17This device is asking for an unknown resource type.Device is requesting an unknown resource type.
18Reinstall the drivers for this device.Device drivers must be reinstalled.
19Failure using the VxD loader.
20Your registry might be corrupted.Registry might be corrupted.
21System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device.System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.
22This device is disabled.Device is disabled.
23System failure: Try changing the driver for this device. If that doesn't work, see your hardware documentation.System failure. If changing the device driver is ineffective, see the hardware documentation.
24This device is not present, is not working properly, or does not have all its drivers installed.Device is not present, not working properly, or does not have all of its drivers installed.
25Windows is still setting up this device.Windows is still setting up the device.
26Windows is still setting up this device.Windows is still setting up the device.
27This device does not have valid log configuration.Device does not have valid log configuration.
28The drivers for this device are not installed.Device drivers are not installed.
29This device is disabled because the firmware of the device did not give it the required resources.Device is disabled. The device firmware did not provide the required resources.
30This device is using an Interrupt Request (IRQ) resource that another device is using.Device is using an IRQ resource that another device is using.
31This device is not working properly because Windows cannot load the drivers required for this device.Device is not working properly. Windows cannot load the required device drivers.
Code
# Value of ConfigManagerErrorCode for each instance
# Lookup table for ConfigManagerErrorCode (values documented by Microsoft)
$configManagerErrorCodeName = @{
    0 = 'This device is working properly'
    1 = 'This device is not configured correctly'
    2 = 'Windows cannot load the driver for this device'
    3 = 'The driver for this device might be corrupted, or your…'
    4 = 'This device is not working properly'
    5 = 'The driver for this device needs a resource that Windows…'
    6 = 'The boot configuration for this device conflicts with other…'
    7 = 'Cannot filter'
    8 = 'The driver loader for the device is missing'
    9 = 'This device is not working properly because the controlling…'
    10 = 'This device cannot start'
    11 = 'This device failed'
    12 = 'This device cannot find enough free resources that it can use'
    13 = 'Windows cannot verify this device''s resources'
    14 = 'This device cannot work properly until you restart your…'
    15 = 'This device is not working properly because there is…'
    16 = 'Windows cannot identify all the resources this device uses'
    17 = 'This device is asking for an unknown resource type'
    18 = 'Reinstall the drivers for this device'
    19 = 'Failure using the VxD loader'
    20 = 'Your registry might be corrupted'
    21 = 'System failure: Try changing the driver for this device'
    22 = 'This device is disabled'
    23 = 'System failure: Try changing the driver for this device'
    24 = 'This device is not present, is not working properly, or does…'
    25 = 'Windows is still setting up this device'
    26 = 'Windows is still setting up this device'
    27 = 'This device does not have valid log configuration'
    28 = 'The drivers for this device are not installed'
    29 = 'This device is disabled because the firmware of the device…'
    30 = 'This device is using an Interrupt Request (IRQ) resource…'
    31 = 'This device is not working properly because Windows cannot…'
}
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, ConfigManagerErrorCode |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'ConfigManagerErrorCode'; Expression = { $configManagerErrorCodeName[[int]$_.ConfigManagerErrorCode] } }
    )
ConfigManagerUserConfigbooleanread

If True, the device is using a user-defined configuration.

Code
# Value of ConfigManagerUserConfig for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, ConfigManagerUserConfig |
    Select-Object -Property DeviceID, ConfigManagerUserConfig
CreationClassName keystringread

Name of the first concrete class that appears in the inheritance chain used in the creation of an instance. When used with the other key properties of the class, the property allows all instances of this class and its subclasses to be identified uniquely.

Code
# Value of CreationClassName for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, CreationClassName |
    Select-Object -Property DeviceID, CreationClassName
DefaultBlockSizeuint64read

Default block size, in bytes, for this device.

For more information about using uint64 values in scripts, see Scripting in WMI.

Unit: bytes

Code
# Value of DefaultBlockSize for each instance
# DefaultBlockSize is expressed in bytes: converted to GB
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, DefaultBlockSize |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'DefaultBlockSizeGB'; Expression = { [math]::Round($_.DefaultBlockSize / 1GB, 2) } }
    )
Descriptionstringread

Description of the object.

Code
# Value of Description for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, Description |
    Select-Object -Property DeviceID, Description
DeviceID keystringread

Unique identifier for a CD-ROM drive.

Code
# Value of DeviceID for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID |
    Select-Object -Property DeviceID
Drivestringread

Drive letter of the CD-ROM drive.

Example: "d:\"

Code
# Value of Drive for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, Drive |
    Select-Object -Property DeviceID, Drive
DriveIntegritybooleanread

If True, files can be accurately read from the CD device. This is achieved by reading a block of data twice and comparing the data against itself.

Code
# Value of DriveIntegrity for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, DriveIntegrity |
    Select-Object -Property DeviceID, DriveIntegrity
ErrorClearedbooleanread

If True, the error reported in LastErrorCode is now cleared.

Code
# Value of ErrorCleared for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, ErrorCleared |
    Select-Object -Property DeviceID, ErrorCleared
ErrorDescriptionstringread

More information about the error recorded in LastErrorCode, and information about corrective actions that can be taken.

Code
# Value of ErrorDescription for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, ErrorDescription |
    Select-Object -Property DeviceID, ErrorDescription
ErrorMethodologystringread

Type of error detection and correction supported by this device.

Code
# Value of ErrorMethodology for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, ErrorMethodology |
    Select-Object -Property DeviceID, ErrorMethodology
FileSystemFlagsuint16read

This property is obsolete. In place of this property, use FileSystemFlagsEx.

Code
# Value of FileSystemFlags for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, FileSystemFlags |
    Select-Object -Property DeviceID, FileSystemFlags
FileSystemFlagsExuint32read

File system flags associated with the Windows CD-ROM drive. This parameter can be any combination of flags, but FS_FILE_COMPRESSION and FS_VOL_IS_COMPRESSED are mutually exclusive.

Example: 0

Values (15)
ValueLabelDescription
1Case Sensitive SearchThe file system supports case-sensitive file names.
2Case Preserved NamesThe file system preserves the case of file names when it places a name on a disk.
4Unicode On DiskThe file system supports Unicode in file names as they appear on the disk.
8Persistent ACLsThe file system preserves and enforces access control lists (ACLs). For example, the NTFS file system preserves and enforces ACLs and the FAT file system does not.
16File CompressionThe file system supports file-based compression.
32Volume QuotasThe file system supports disk quotas.
64Supports Sparse FilesThe file system supports spare files.
128Supports Reparse PointsThe file system supports reparse points.
256Supports Remote StorageThe file system supports the remote storage of files.
16384Supports Long NamesThe file system supports file names that are longer than eight characters.
32768Volume Is CompressedThe specified disk volume is a compressed volume, for example, a DoubleSpace volume.
524289Read Only VolumeThe specified volume is read-only.
65536Supports Object IDSThe file system supports object identifiers.
131072Supports EncryptionThe file system supports the Encrypted File System (EFS).
262144Supports Named StreamsThe file system supports named streams.
Code
# Value of FileSystemFlagsEx for each instance
# Lookup table for FileSystemFlagsEx (values documented by Microsoft)
$fileSystemFlagsExName = @{
    1 = 'Case Sensitive Search'
    2 = 'Case Preserved Names'
    4 = 'Unicode On Disk'
    8 = 'Persistent ACLs'
    16 = 'File Compression'
    32 = 'Volume Quotas'
    64 = 'Supports Sparse Files'
    128 = 'Supports Reparse Points'
    256 = 'Supports Remote Storage'
    16384 = 'Supports Long Names'
    32768 = 'Volume Is Compressed'
    65536 = 'Supports Object IDS'
    131072 = 'Supports Encryption'
    262144 = 'Supports Named Streams'
    524289 = 'Read Only Volume'
}
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, FileSystemFlagsEx |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'FileSystemFlagsEx'; Expression = { $fileSystemFlagsExName[[int]$_.FileSystemFlagsEx] } }
    )
Idstringread

Drive letter that uniquely identifies this CD-ROM drive.

Example: "d:\"

Code
# Value of Id for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, Id |
    Select-Object -Property DeviceID, Id
InstallDatedatetimeread

Date and time the object is installed. This property does not need a value to indicate that the object is installed.

Code
# Value of InstallDate for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, InstallDate |
    Select-Object -Property DeviceID, InstallDate
LastErrorCodeuint32read

Last error code reported by the logical device.

Code
# Value of LastErrorCode for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, LastErrorCode |
    Select-Object -Property DeviceID, LastErrorCode
Manufacturerstringread

Manufacturer of the Windows CD-ROM drive.

Example: "PLEXTOR"

Code
# Value of Manufacturer for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, Manufacturer |
    Select-Object -Property DeviceID, Manufacturer
MaxBlockSizeuint64read

Maximum block size, in bytes, for media accessed by this device.

For more information about using uint64 values in scripts, see Scripting in WMI.

Unit: bytes

Code
# Value of MaxBlockSize for each instance
# MaxBlockSize is expressed in bytes: converted to GB
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, MaxBlockSize |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'MaxBlockSizeGB'; Expression = { [math]::Round($_.MaxBlockSize / 1GB, 2) } }
    )
MaximumComponentLengthuint32read

Maximum length of a filename component supported by the Windows CD-ROM drive. A file name component the portion of a file name between backslashes. The value can be used to indicate that long names are supported by the specified file system. For example, for a FAT file system supporting long names, the function stores the value 255, rather than the previous 8.3 indicator. Long names can also be supported on systems that use the NTFS file system.

Example: 255

Code
# Value of MaximumComponentLength for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, MaximumComponentLength |
    Select-Object -Property DeviceID, MaximumComponentLength
MaxMediaSizeuint64read

Maximum size, in kilobytes, of media supported by this device.

For more information about using uint64 values in scripts, see Scripting in WMI.

Unit: kilobytes

Code
# Value of MaxMediaSize for each instance
# MaxMediaSize is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, MaxMediaSize |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'MaxMediaSizeGB'; Expression = { [math]::Round($_.MaxMediaSize / 1MB, 2) } }
    )
MediaLoadedbooleanread

If True, a CD-ROM is in the drive.

Code
# Value of MediaLoaded for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, MediaLoaded |
    Select-Object -Property DeviceID, MediaLoaded
MediaTypestringread

Type of media that can be used or accessed by this device. Possible values are:

Values (4)
ValueLabelDescription
Random AccessRandom Access
Supports WritingSupports Writing
Removable MediaRemovable Media
CD-ROMCD-ROM
Code
# Value of MediaType for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, MediaType |
    Select-Object -Property DeviceID, MediaType
MfrAssignedRevisionLevelstringread

Firmware revision level that is assigned by the manufacturer.

Code
# Value of MfrAssignedRevisionLevel for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, MfrAssignedRevisionLevel |
    Select-Object -Property DeviceID, MfrAssignedRevisionLevel
MinBlockSizeuint64read

Minimum block size, in bytes, for media accessed by this device.

For more information about using uint64 values in scripts, see Scripting in WMI.

Unit: bytes

Code
# Value of MinBlockSize for each instance
# MinBlockSize is expressed in bytes: converted to GB
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, MinBlockSize |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'MinBlockSizeGB'; Expression = { [math]::Round($_.MinBlockSize / 1GB, 2) } }
    )
Namestringread

Label for the object. When subclassed, the property can be overridden to be a key property.

Code
# Value of Name for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, Name |
    Select-Object -Property DeviceID, Name
NeedsCleaningbooleanread

If True, the media access device needs cleaning. Whether manual or automatic cleaning is possible is indicated in the Capabilities property.

Code
# Value of NeedsCleaning for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, NeedsCleaning |
    Select-Object -Property DeviceID, NeedsCleaning
NumberOfMediaSupporteduint32read

Maximum number of media that can be supported or inserted, when the media access device supports multiple individual media.

Code
# Value of NumberOfMediaSupported for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, NumberOfMediaSupported |
    Select-Object -Property DeviceID, NumberOfMediaSupported
PNPDeviceIDstringread

Windows Plug and Play device identifier of the logical device.

Example: "*PNP030b"

Code
# Value of PNPDeviceID for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, PNPDeviceID |
    Select-Object -Property DeviceID, PNPDeviceID
PowerManagementCapabilitiesuint16[]read

Array of the specific power-related capabilities of a logical device.

Values (8)
ValueLabelDescription
0Unknown
1Not SupportedPower-related capacities are not supported for this device.
2Disabled
3EnabledThe power management features are currently enabled but the exact feature set is unknown or the information is unavailable.
4Power Saving Modes Entered AutomaticallyThe device can change its power state based on usage or other criteria.
5Power State SettableThe SetPowerState method is supported. This method is found on the parent **CIM_LogicalDevice** class and can be implemented. For more information, see Designing Managed Object Format (MOF) Classes.
6Power Cycling SupportedThe SetPowerState method can be invoked with the *PowerState*parameter set to 5 (Power Cycle).
7Timed Power On SupportedTimed Power-On Supported The SetPowerState method can be invoked with the *PowerState* parameter set to 5 (Power Cycle) and *Time* set to a specific date and time, or interval, for power-on.
Code
# Value of PowerManagementCapabilities for each instance
# Lookup table for PowerManagementCapabilities (values documented by Microsoft)
$powerManagementCapabilitiesName = @{
    0 = 'Unknown'
    1 = 'Not Supported'
    2 = 'Disabled'
    3 = 'Enabled'
    4 = 'Power Saving Modes Entered Automatically'
    5 = 'Power State Settable'
    6 = 'Power Cycling Supported'
    7 = 'Timed Power On Supported'
}
# PowerManagementCapabilities is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_CDROMDrive -Property PowerManagementCapabilities |
    Select-Object -ExpandProperty PowerManagementCapabilities |
    ForEach-Object -Process { $powerManagementCapabilitiesName[[int]$_] }
PowerManagementSupportedbooleanread

If True, the device can be power-managed, which means that it can be put into suspend mode, and so on. The property does not indicate that power management features are currently enabled, only that the logical device is capable of power management.

Code
# Value of PowerManagementSupported for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, PowerManagementSupported |
    Select-Object -Property DeviceID, PowerManagementSupported
RevisionLevelstringread

Firmware revision level of the Windows CD-ROM drive.

Code
# Value of RevisionLevel for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, RevisionLevel |
    Select-Object -Property DeviceID, RevisionLevel
SCSIBusuint32read

SCSI bus number for the disk drive.

Example: 0

Code
# Value of SCSIBus for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, SCSIBus |
    Select-Object -Property DeviceID, SCSIBus
SCSILogicalUnituint16read

SCSI logical unit number (LUN) of the disk drive. The LUN is used to designate which SCSI controller is being accessed in a system with more than one controller being used. The SCSI device identifier is similar, but is the designation for multiple devices on one controller.

Example: 0

Code
# Value of SCSILogicalUnit for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, SCSILogicalUnit |
    Select-Object -Property DeviceID, SCSILogicalUnit
SCSIPortuint16read

SCSI port number of the disk drive.

Example: 1

Code
# Value of SCSIPort for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, SCSIPort |
    Select-Object -Property DeviceID, SCSIPort
SCSITargetIduint16read

SCSI identifier number of the Windows CD-ROM drive.

Example: 0

Code
# Value of SCSITargetId for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, SCSITargetId |
    Select-Object -Property DeviceID, SCSITargetId
SerialNumberstringread

Number supplied by the manufacturer that identifies the physical media. Example: WD-WM3493798728.

Code
# Value of SerialNumber for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, SerialNumber |
    Select-Object -Property DeviceID, SerialNumber
Sizeuint64read

Size of the disk drive.

For more information about using uint64 values in scripts, see Scripting in WMI.

Unit: bytes

Code
# Value of Size for each instance
# Size is expressed in bytes: converted to GB
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, Size |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'SizeGB'; Expression = { [math]::Round($_.Size / 1GB, 2) } }
    )
Statusstringread

Current status of the object. Various operational and nonoperational statuses can be defined. Operational statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is online, yet the managed element is neither "OK" nor in one of the other states.

Values include the following:

Values (12)
ValueLabelDescription
OKOK
ErrorError
DegradedDegraded
UnknownUnknown
Pred FailPred Fail
StartingStarting
StoppingStopping
ServiceService
StressedStressed
NonRecoverNonRecover
No ContactNo Contact
Lost CommLost Comm
Code
# Value of Status for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, Status |
    Select-Object -Property DeviceID, Status
StatusInfouint16read

State of the logical device. If this property does not apply to the logical device, the value 5 (Not Applicable) should be used.

Values (5)
ValueLabelDescription
1Other
2Unknown
3Enabled
4Disabled
5Not Applicable
Code
# Value of StatusInfo for each instance
# Lookup table for StatusInfo (values documented by Microsoft)
$statusInfoName = @{
    1 = 'Other'
    2 = 'Unknown'
    3 = 'Enabled'
    4 = 'Disabled'
    5 = 'Not Applicable'
}
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, StatusInfo |
    Select-Object -Property @(
        'DeviceID'
        @{ Name = 'StatusInfo'; Expression = { $statusInfoName[[int]$_.StatusInfo] } }
    )
SystemCreationClassName keystringread

Value of the scoping computer's CreationClassName property.

Code
# Value of SystemCreationClassName for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, SystemCreationClassName |
    Select-Object -Property DeviceID, SystemCreationClassName
SystemName keystringread

Name of the scoping system.

Code
# Value of SystemName for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, SystemName |
    Select-Object -Property DeviceID, SystemName
TransferRatereal64read

Transfer rate of the CD-ROM drive. A value of -1 indicates that the rate cannot be determined. When this happens, the CD is not in the drive.

Unit: kilobytes per second

Code
# Value of TransferRate for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, TransferRate |
    Select-Object -Property DeviceID, TransferRate
VolumeNamestringread

Volume name of the Windows CD-ROM drive.

Code
# Value of VolumeName for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, VolumeName |
    Select-Object -Property DeviceID, VolumeName
VolumeSerialNumberstringread

Volume serial number of the media in the CD-ROM drive.

Example: A8C3-D032

Code
# Value of VolumeSerialNumber for each instance
Get-CimInstance -ClassName Win32_CDROMDrive -Property DeviceID, VolumeSerialNumber |
    Select-Object -Property DeviceID, VolumeSerialNumber

Remarks

The Win32_CDROMDrive class is derived from CIM_CDROMDrive which derives from CIM_MediaAccessDevice. The CIM_MediaAccessDevice class derives from CIM_LogicalDevice.

Inheritance

Superclass chain

  1. CIM_ManagedSystemElement
  2. CIM_LogicalElement
  3. CIM_LogicalDevice
  4. CIM_MediaAccessDevice
  5. CIM_CDROMDrive
  6. Win32_CDROMDrive

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("{8502C4B3-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.