Main example
List instances
# Abstract class: Get-CimInstance returns the instances of its subclasses
Get-CimInstance -ClassName CIM_UnitaryComputerSystem |
Select-Object -Property Name, Description, Status, InstallDateAbstract class: it has no instances of its own. Get-CimInstance returns the instances of its subclasses (Win32_ComputerSystem).
Examples
Decode numeric values
# Lookup table for PowerState (values documented by Microsoft)
$powerStateName = @{
0 = 'Unknown'
1 = 'Full Power'
2 = 'Power Save - Low Power Mode'
3 = 'Power Save - Standby'
4 = 'Power Save - Unknown'
5 = 'Power Cycle'
6 = 'Power Off'
7 = 'Power Save - Warning'
8 = 'Power Save - Hibernate'
9 = 'Power Save - Soft Off'
}
# Lookup table for ResetCapability (values documented by Microsoft)
$resetCapabilityName = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Disabled'
4 = 'Enabled'
5 = 'Not Implemented'
}
Get-CimInstance -ClassName CIM_UnitaryComputerSystem |
Select-Object -Property @(
'Name'
'Description'
'Status'
'InstallDate'
@{ Name = 'PowerState'; Expression = { $powerStateName[[int]$_.PowerState] } }
@{ Name = 'ResetCapability'; Expression = { $resetCapabilityName[[int]$_.ResetCapability] } }
)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 CIM_UnitaryComputerSystem |
Select-Object -Property Name, Description, Status, InstallDate
} 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 CIM_UnitaryComputerSystem
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, FlagsProperties
| Name | Type | Access | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Caption# | string | read | Short textual description of the object. Code | |||||||||||||||||||||||||||||||||||||||||||||
| CreationClassName# key | string | read | Name of the class or subclass used in the creation of an instance. When used with other key properties of the class, this property allows all instances of the class and its subclasses to be uniquely identified. Code | |||||||||||||||||||||||||||||||||||||||||||||
| Description# | string | read | Textual description of the object. Code | |||||||||||||||||||||||||||||||||||||||||||||
| InitialLoadInfo# | string[] | read | Data needed to find either the initial load device (its key) or the boot service to request the operating system to start. In addition, the load parameters (that is, a path name and parameters) can also be specified. Code | |||||||||||||||||||||||||||||||||||||||||||||
| InstallDate# | datetime | read | Date and time the object was installed. This property does not need a value to indicate that the object is installed. Code | |||||||||||||||||||||||||||||||||||||||||||||
| LastLoadInfo# | string | read | Data that identifies either the initial load device (its key) or the boot service that requested the last operating system load. In addition, the load parameters (that is, a path name and parameters) can also be specified. Code | |||||||||||||||||||||||||||||||||||||||||||||
| Name# key | string | read | Label by which the object is known. When subclassed, this property can be overridden to be a key property. Code | |||||||||||||||||||||||||||||||||||||||||||||
| NameFormat# | string | read | The CIM_ComputerSystem object and its derivatives are top-level objects of CIM that provide the scope for numerous components and require unique CIM_System keys. A heuristic is defined to create the CIM_ComputerSystem name in an attempt to always generate the same system name, independent of discovery protocol. This prevents inventory and management problems where the same asset or entity is discovered multiple times, but cannot be resolved to a single object. This property identifies how the system name was generated by using the subclass heuristic. The heuristic is outlined in the CIM V2 Common Model specification and assumes that the documented rules are traversed to determine and assign a name. The NameFormat values list defines the precedence order for assigning the system name with several rules mapping to the same value. Note that the CIM_ComputerSystem name that is calculated using the heuristic is the system's key value. Other names can be assigned and used for the CIM_ComputerSystem that better suit the business, using aliases. Values include the following: Values (14)
Code | |||||||||||||||||||||||||||||||||||||||||||||
| PowerManagementCapabilities# | uint16[] | read | Array of the specific power-related capabilities of a logical device. Values (8)
Code | |||||||||||||||||||||||||||||||||||||||||||||
| PowerManagementSupported# | boolean | read | If TRUE, the device can be power managed, that is, put into a power-save state. If FALSE, the integer value 1 ("Not Supported") should be the only entry in the PowerManagementCapabilities array. This property does not indicate whether power management features are currently enabled, or if enabled, which features are supported. For more information, see the PowerManagementCapabilities array. Code | |||||||||||||||||||||||||||||||||||||||||||||
| PowerState# | uint16 | read | Current power state of the computer system and its associated operating system. Values (10)
Code | |||||||||||||||||||||||||||||||||||||||||||||
| PrimaryOwnerContact# | string | read | String that provides information on how to reach the primary system owner (for example, phone number, email address, and so on). Code | |||||||||||||||||||||||||||||||||||||||||||||
| PrimaryOwnerName# | string | read | Name of the primary system owner. Code | |||||||||||||||||||||||||||||||||||||||||||||
| ResetCapability# | uint16 | read | If enabled, the unitary computer system can be reset with hardware (for example, with the power and reset buttons). If disabled, hardware reset is not allowed. Values (5)
Code | |||||||||||||||||||||||||||||||||||||||||||||
| Roles# | string[] | read/write | Roles the system plays in the information technology environment. Subclasses of the system can override this property to define explicit role values. Alternately, a working group can describe the heuristics, conventions, and guidelines for specifying roles. For example, for an instance of a networking system, this property might contain the string "Switch" or "Bridge". CodeWarning. Changes the system: check with -WhatIf first. An elevated console is often required. | |||||||||||||||||||||||||||||||||||||||||||||
| Status# | string | read | Current status of the object. This property is inherited from CIM_ManagedSystemElement. Values include the following: Values (12)
Code |
Remarks
The CIM_UnitaryComputerSystem class is derived from CIM_ComputerSystem.
WMI does not implement this class. For WMI classes derived from CIM_UnitaryComputerSystem, see Win32 Classes.
This documentation is derived from the CIM class descriptions published by the DMTF. Microsoft may have made changes to correct minor errors, conform to Microsoft SDK documentation standards, or provide more information.
Inheritance
Superclass chain
- CIM_ManagedSystemElement
- CIM_LogicalElement
- CIM_System
- CIM_ComputerSystem
- CIM_UnitaryComputerSystem
Known subclasses
Requirements
- Namespace
- root/cimv2
- Minimum client
- Windows Vista
- Minimum server
- Windows Server 2008
- MOF file
- CIMWin32.mof
- DLL
- CIMWin32.dll
Class qualifiers
Abstract UUID("{8502C526-5FBB-11D2-AAC1-006008C78BC7}") AMENDMENT
Microsoft source
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.