Win32_SystemEnclosure

The Win32_SystemEnclosure WMI class represents the properties that are associated with a physical system enclosure.

The Win32_SystemEnclosure WMI class represents the properties that are associated with a physical system enclosure.

Methods

Win32_SystemEnclosure has no methods. Inherited methods (IsCompatible) are not implemented.

Properties

Win32_SystemEnclosure returns 37 properties:

'AudibleAlarm','BreachDescription','CableManagementStrategy','Caption',
'ChassisTypes','CreationClassName','CurrentRequiredOrProduced','Depth','Description',
'HeatGeneration','Height','HotSwappable','InstallDate','LockPresent','Manufacturer','Model','Name',
'NumberOfPowerCords','OtherIdentifyingInfo','PartNumber','PoweredOn','Removable','Replaceable',
'SecurityBreach','SecurityStatus','SerialNumber','ServiceDescriptions','ServicePhilosophy','SKU',
'SMBIOSAssetTag','Status','Tag','TypeDescriptions','Version','VisibleAlarm','Weight','Width'

Unless explicitly marked as writeable, all properties are read-only. Read all properties for all instances:

Get-CimInstance -ClassName Win32_SystemEnclosure -Property *

Most WMI classes return one or more instances.

When Get-CimInstance returns no result, then apparently no instances of class Win32_SystemEnclosure exist. This is normal behavior.

Either the class is not implemented on your system (may be deprecated or due to missing drivers, i.e. CIM_VideoControllerResolution), or there are simply no physical representations of this class currently available (i.e. Win32_TapeDrive).

AudibleAlarm

BOOLEAN

If TRUE, the frame is equipped with an audible alarm.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, AudibleAlarm

BreachDescription

STRING

Free-form string that provides more information if the SecurityBreach property indicates that a security-related event occurred.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, BreachDescription

CableManagementStrategy

STRING

Free-form string that contains information about how the various cables are connected and bundled for the frame. With many networking, storage-related, and power cables, cable management can be a complex and challenging endeavor. This property contains information to aid in assembly and service of the frame.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, CableManagementStrategy

Caption

STRING MAX 64 CHAR

Short description of the object—a one-line string.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Caption

ChassisTypes

UINT16 ARRAY

Array of chassis types.

This value comes from the Type member of the System Enclosure or Chassis structure in the SMBIOS information.

ChassisTypes returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$ChassisTypes_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'Desktop'
      4 = 'Low Profile Desktop'
      5 = 'Pizza Box'
      6 = 'Mini Tower'
      7 = 'Tower'
      8 = 'Portable'
      9 = 'Laptop'
     10 = 'Notebook'
     11 = 'Hand Held'
     12 = 'Docking Station'
     13 = 'All in One'
     14 = 'Sub Notebook'
     15 = 'Space-Saving'
     16 = 'Lunch Box'
     17 = 'Main System Chassis'
     18 = 'Expansion Chassis'
     19 = 'SubChassis'
     20 = 'Bus Expansion Chassis'
     21 = 'Peripheral Chassis'
     22 = 'Storage Chassis'
     23 = 'Rack Mount Chassis'
     24 = 'Sealed-Case PC'
}
Use a switch statement
switch([int]$value)
{
  1          {'Other'}
  2          {'Unknown'}
  3          {'Desktop'}
  4          {'Low Profile Desktop'}
  5          {'Pizza Box'}
  6          {'Mini Tower'}
  7          {'Tower'}
  8          {'Portable'}
  9          {'Laptop'}
  10         {'Notebook'}
  11         {'Hand Held'}
  12         {'Docking Station'}
  13         {'All in One'}
  14         {'Sub Notebook'}
  15         {'Space-Saving'}
  16         {'Lunch Box'}
  17         {'Main System Chassis'}
  18         {'Expansion Chassis'}
  19         {'SubChassis'}
  20         {'Bus Expansion Chassis'}
  21         {'Peripheral Chassis'}
  22         {'Storage Chassis'}
  23         {'Rack Mount Chassis'}
  24         {'Sealed-Case PC'}
  default    {"$value"}
}
Use Enum structure
Enum EnumChassisTypes
{
  Other                   = 1
  Unknown                 = 2
  Desktop                 = 3
  Low_Profile_Desktop     = 4
  Pizza_Box               = 5
  Mini_Tower              = 6
  Tower                   = 7
  Portable                = 8
  Laptop                  = 9
  Notebook                = 10
  Hand_Held               = 11
  Docking_Station         = 12
  All_in_One              = 13
  Sub_Notebook            = 14
  Space_Saving            = 15
  Lunch_Box               = 16
  Main_System_Chassis     = 17
  Expansion_Chassis       = 18
  SubChassis              = 19
  Bus_Expansion_Chassis   = 20
  Peripheral_Chassis      = 21
  Storage_Chassis         = 22
  Rack_Mount_Chassis      = 23
  Sealed_Case_PC          = 24
}

Examples

Use $ChassisTypes_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "ChassisTypes" to friendly text

  Note: to use other properties than "ChassisTypes", look up the appropriate 
  translation hashtable for the property you would like to use instead.
#>

#region define hashtable to translate raw values to friendly text

# Please note: this hashtable is specific for property "ChassisTypes" 
# to translate other properties, use their translation table instead
$ChassisTypes_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'Desktop'
      4 = 'Low Profile Desktop'
      5 = 'Pizza Box'
      6 = 'Mini Tower'
      7 = 'Tower'
      8 = 'Portable'
      9 = 'Laptop'
     10 = 'Notebook'
     11 = 'Hand Held'
     12 = 'Docking Station'
     13 = 'All in One'
     14 = 'Sub Notebook'
     15 = 'Space-Saving'
     16 = 'Lunch Box'
     17 = 'Main System Chassis'
     18 = 'Expansion Chassis'
     19 = 'SubChassis'
     20 = 'Bus Expansion Chassis'
     21 = 'Peripheral Chassis'
     22 = 'Storage Chassis'
     23 = 'Rack Mount Chassis'
     24 = 'Sealed-Case PC'
}

#endregion define hashtable

#region define calculated property (to be used with Select-Object)

<#
  a calculated property is defined by a hashtable with keys "Name" and "Expression"
  "Name" defines the name of the property (in this example, it is "ChassisTypes", but you can rename it to anything else)
  "Expression" defines a scriptblock that calculates the content of this property
  in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
  value to its friendly text counterpart:
#>
 
$ChassisTypes = @{
  Name = 'ChassisTypes'
  Expression = {
    # property is an array, so process all values
    $result = foreach($value in $_.ChassisTypes)
    {
        # important: convert original value to [int] because
        # hashtable keys are type-aware:
        $ChassisTypes_map[[int]$value]
    }
    # uncomment to get a comma-separated string instead
    # of a string array:
    $result <#-join ', '#>
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "ChassisTypes". The latter
# is defined by the hashtable in $ChassisTypes: 
Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -Property Caption, $ChassisTypes

# ...or dump content of property ChassisTypes:
$friendlyValues = Get-CimInstance -Class Win32_SystemEnclosure | 
    Select-Object -Property $ChassisTypes |
    Select-Object -ExpandProperty ChassisTypes

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $ChassisTypes_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_SystemEnclosure" to friendly text. This approach is ideal when there
  is just one instance to work with.

  Note: to use other properties than "Win32_SystemEnclosure", look up the appropriate 
  translation hashtable for the property you would like to use instead.
#>

#region define hashtable to translate raw values to friendly text

# Please note: this hashtable is specific for property "Win32_SystemEnclosure" 
# to translate other properties, use their translation table instead
$ChassisTypes_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'Desktop'
      4 = 'Low Profile Desktop'
      5 = 'Pizza Box'
      6 = 'Mini Tower'
      7 = 'Tower'
      8 = 'Portable'
      9 = 'Laptop'
     10 = 'Notebook'
     11 = 'Hand Held'
     12 = 'Docking Station'
     13 = 'All in One'
     14 = 'Sub Notebook'
     15 = 'Space-Saving'
     16 = 'Lunch Box'
     17 = 'Main System Chassis'
     18 = 'Expansion Chassis'
     19 = 'SubChassis'
     20 = 'Bus Expansion Chassis'
     21 = 'Peripheral Chassis'
     22 = 'Storage Chassis'
     23 = 'Rack Mount Chassis'
     24 = 'Sealed-Case PC'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -First 1

<#
  IMPORTANT: this example processes only one instance to illustrate
  the number-to-text translation. To process all instances, replace
  "Select-Object -First 1" with a "Foreach-Object" loop, and use
  the iterator variable $_ instead of $instance
#>

# query the property (hint: the property is an array!)
$rawValues = $instance.ChassisTypes  

# translate all raw values into friendly names:
$friendlyNames = foreach($rawValue in $rawValues)
{ $ChassisTypes_map[[int]$rawValue] }

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use a switch statement inside a calculated property for Select-Object
<# 
  this example uses a switch clause to translate raw numeric 
  values for property "ChassisTypes" to friendly text. The switch
  clause is embedded into a calculated property so there is
  no need to refer to external variables for translation.

  Note: to use other properties than "ChassisTypes", look up the appropriate 
  translation switch clause for the property you would like to use instead.
#>

#region define calculated property (to be used with Select-Object)

<#
  a calculated property is defined by a hashtable with keys "Name" and "Expression"
  "Name" defines the name of the property (in this example, it is "ChassisTypes", but you can rename it to anything else)
  "Expression" defines a scriptblock that calculates the content of this property
  in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
  value to its friendly text counterpart:
#>
 
$ChassisTypes = @{
  Name = 'ChassisTypes'
  Expression = {
    # property is an array, so process all values
    $result = foreach($value in $_.ChassisTypes)
    {
        switch([int]$value)
      {
        1          {'Other'}
        2          {'Unknown'}
        3          {'Desktop'}
        4          {'Low Profile Desktop'}
        5          {'Pizza Box'}
        6          {'Mini Tower'}
        7          {'Tower'}
        8          {'Portable'}
        9          {'Laptop'}
        10         {'Notebook'}
        11         {'Hand Held'}
        12         {'Docking Station'}
        13         {'All in One'}
        14         {'Sub Notebook'}
        15         {'Space-Saving'}
        16         {'Lunch Box'}
        17         {'Main System Chassis'}
        18         {'Expansion Chassis'}
        19         {'SubChassis'}
        20         {'Bus Expansion Chassis'}
        21         {'Peripheral Chassis'}
        22         {'Storage Chassis'}
        23         {'Rack Mount Chassis'}
        24         {'Sealed-Case PC'}
        default    {"$value"}
      }
      
    }
    $result
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_SystemEnclosure | 
  # ...and output properties "Caption" and "ChassisTypes". The latter is defined
  # by the hashtable in $ChassisTypes:
  Select-Object -Property Caption, $ChassisTypes
Use the Enum from above to auto-translate the code values
<# 
  this example translates raw values by means of type conversion
  the friendly names are defined as enumeration using the
  keyword "enum" (PowerShell 5 or better)
  
  The raw value(s) are translated to friendly text by 
  simply converting them into the enum type.
  
  Note: to use other properties than "Win32_SystemEnclosure", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumChassisTypes
{
  Other                   = 1
  Unknown                 = 2
  Desktop                 = 3
  Low_Profile_Desktop     = 4
  Pizza_Box               = 5
  Mini_Tower              = 6
  Tower                   = 7
  Portable                = 8
  Laptop                  = 9
  Notebook                = 10
  Hand_Held               = 11
  Docking_Station         = 12
  All_in_One              = 13
  Sub_Notebook            = 14
  Space_Saving            = 15
  Lunch_Box               = 16
  Main_System_Chassis     = 17
  Expansion_Chassis       = 18
  SubChassis              = 19
  Bus_Expansion_Chassis   = 20
  Peripheral_Chassis      = 21
  Storage_Chassis         = 22
  Rack_Mount_Chassis      = 23
  Sealed_Case_PC          = 24
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -First 1

<#
  IMPORTANT: this example processes only one instance to focus on
  the number-to-text type conversion. 
  
  To process all instances, replace   "Select-Object -First 1" 
  with a "Foreach-Object" loop, and use the iterator variable 
  $_ instead of $instance
#>

# query the property:
$rawValue = $instance.ChassisTypes

#region using strict type conversion

<#
  Note: strict type conversion fails if the raw value is 
  not defined by the enum. So if the list of allowable values
  was extended and the enum does not match the value,
  an exception is thrown
#>

# convert the property to the enum **ChassisTypes** 
[EnumChassisTypes[]]$rawValue 

# get a comma-separated string:
[EnumChassisTypes[]]$rawValue -join ',' 
#endregion

#region using operator "-as"

<#
  Note: the operator "-as" accepts values not defined
  by the enum and returns $null instead of throwing
  an exception
#>

$rawValue -as [EnumChassisTypes[]]
#endregion

Enums must cover all possible values. If ChassisTypes returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.

CreationClassName

STRING MAX 256 CHAR

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

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, CreationClassName

CurrentRequiredOrProduced

SINT16 “AMPS AT 120 VOLTS”

Current that is required by the chassis at 120V. If power is provided by the chassis—as in the case of an uninterruptible power supply (UPS)—this property may indicate the amperage produced (as a negative number).

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, CurrentRequiredOrProduced

Depth

REAL32 “INCHES”

Depth of the physical package—in inches.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Depth

Description

STRING

Description of the object.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Description

HeatGeneration

UINT16 “BTU PER HOUR”

Amount of heat that is generated by the chassis in BTU/hour.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, HeatGeneration

Height

REAL32 “INCHES”

Height of the physical package—in inches.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Height

HotSwappable

BOOLEAN

If TRUE, a physical package can be hot-swapped (if it is possible to replace the element with a physically different but equivalent one while the containing package has power applied to it). For example, a disk drive package that is inserted using SCA connectors is removable and can be hot-swapped. All packages that can be hot-swapped are inherently removable and replaceable.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, HotSwappable

InstallDate

DATETIME

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

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, InstallDate

LockPresent

BOOLEAN

If TRUE, the frame is protected with a lock.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, LockPresent

Manufacturer

STRING MAX 256 CHAR

Name of the organization that produces the physical element.

This value comes from the Manufacturer member of the System Enclosure or Chassis structure in the SMBIOS information.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Manufacturer

Model

STRING MAX 64 CHAR

Name by which the physical element is known.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Model

Name

STRING

Label by which the object is known. When subclassed, the property can be overridden to be a key property.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Name

NumberOfPowerCords

UINT16

Number of power cords that must be connected to the chassis for all of the components to operate.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, NumberOfPowerCords

OtherIdentifyingInfo

STRING

Additional data, beyond asset tag information, that can be used to identify a physical element. One example is bar code data that is associated with an element that also has an asset tag. Be aware that if only bar code data is available and is unique or able to be used as an element key, this property would be NULL and the bar code data used as the class key, in the tag property.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, OtherIdentifyingInfo

PartNumber

STRING MAX 256 CHAR

Part number that is assigned by the organization that produces or manufacturing the physical element.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, PartNumber

PoweredOn

BOOLEAN

If TRUE, the physical element is powered ON.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, PoweredOn

Removable

BOOLEAN

If TRUE, a physical package is removable (if it is designed to be taken in and out of the physical container in which it is normally found, without impairing the function of the overall packaging). A package can still be removable if the power must be “OFF” to perform the removal. If the package can be removed while the power is ON, then the element is removable and can be hot-swapped. For example, an extra battery in a laptop is removable, as is a disk drive package that is inserted using Server Configuration Application (SCA) connectors. However, the latter can be hot-swapped. A laptop display is not removable, nor is a nonredundant power supply. Removing these components would affect the function of the overall packaging or is impossible because of the tight integration of the package.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Removable

Replaceable

BOOLEAN

If TRUE, this physical media component can be replaced with a physically different one. For example, some computer systems allow the main processor chip to be upgraded to one of a higher clock rating. In this case, the processor is said to be replaceable. Another example is a power supply package mounted on sliding rails. All removable packages are inherently replaceable.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Replaceable

SecurityBreach

UINT16

Status of a physical breach of the frame.

SecurityBreach returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$SecurityBreach_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'No Breach'
      4 = 'Breach Attempted'
      5 = 'Breach Successful'
}
Use a switch statement
switch([int]$value)
{
  1          {'Other'}
  2          {'Unknown'}
  3          {'No Breach'}
  4          {'Breach Attempted'}
  5          {'Breach Successful'}
  default    {"$value"}
}
Use Enum structure
Enum EnumSecurityBreach
{
  Other               = 1
  Unknown             = 2
  No_Breach           = 3
  Breach_Attempted    = 4
  Breach_Successful   = 5
}

Examples

Use $SecurityBreach_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "SecurityBreach" to friendly text

  Note: to use other properties than "SecurityBreach", look up the appropriate 
  translation hashtable for the property you would like to use instead.
#>

#region define hashtable to translate raw values to friendly text

# Please note: this hashtable is specific for property "SecurityBreach" 
# to translate other properties, use their translation table instead
$SecurityBreach_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'No Breach'
      4 = 'Breach Attempted'
      5 = 'Breach Successful'
}

#endregion define hashtable

#region define calculated property (to be used with Select-Object)

<#
  a calculated property is defined by a hashtable with keys "Name" and "Expression"
  "Name" defines the name of the property (in this example, it is "SecurityBreach", but you can rename it to anything else)
  "Expression" defines a scriptblock that calculates the content of this property
  in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
  value to its friendly text counterpart:
#>
 
$SecurityBreach = @{
  Name = 'SecurityBreach'
  Expression = {
    # property is an array, so process all values
    $value = $_.SecurityBreach
    $SecurityBreach_map[[int]$value]
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "SecurityBreach". The latter
# is defined by the hashtable in $SecurityBreach: 
Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -Property Caption, $SecurityBreach

# ...or dump content of property SecurityBreach:
$friendlyValues = Get-CimInstance -Class Win32_SystemEnclosure | 
    Select-Object -Property $SecurityBreach |
    Select-Object -ExpandProperty SecurityBreach

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $SecurityBreach_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_SystemEnclosure" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_SystemEnclosure", look up the appropriate 
  translation hashtable for the property you would like to use instead.
#>

#region define hashtable to translate raw values to friendly text

# Please note: this hashtable is specific for property "Win32_SystemEnclosure" 
# to translate other properties, use their translation table instead
$SecurityBreach_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'No Breach'
      4 = 'Breach Attempted'
      5 = 'Breach Successful'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -First 1

<#
  IMPORTANT: this example processes only one instance to illustrate
  the number-to-text translation. To process all instances, replace
  "Select-Object -First 1" with a "Foreach-Object" loop, and use
  the iterator variable $_ instead of $instance
#>

# query the property
$rawValue = $instance.SecurityBreach  

# translate raw value to friendly text:
$friendlyName = $SecurityBreach_map[[int]$rawValue]

# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<# 
  this example uses a switch clause to translate raw numeric 
  values for property "SecurityBreach" to friendly text. The switch
  clause is embedded into a calculated property so there is
  no need to refer to external variables for translation.

  Note: to use other properties than "SecurityBreach", look up the appropriate 
  translation switch clause for the property you would like to use instead.
#>

#region define calculated property (to be used with Select-Object)

<#
  a calculated property is defined by a hashtable with keys "Name" and "Expression"
  "Name" defines the name of the property (in this example, it is "SecurityBreach", but you can rename it to anything else)
  "Expression" defines a scriptblock that calculates the content of this property
  in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
  value to its friendly text counterpart:
#>
 
$SecurityBreach = @{
  Name = 'SecurityBreach'
  Expression = {
    # property is an array, so process all values
    $value = $_.SecurityBreach
    
    switch([int]$value)
      {
        1          {'Other'}
        2          {'Unknown'}
        3          {'No Breach'}
        4          {'Breach Attempted'}
        5          {'Breach Successful'}
        default    {"$value"}
      }
      
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_SystemEnclosure | 
  # ...and output properties "Caption" and "SecurityBreach". The latter is defined
  # by the hashtable in $SecurityBreach:
  Select-Object -Property Caption, $SecurityBreach
Use the Enum from above to auto-translate the code values
<# 
  this example translates raw values by means of type conversion
  the friendly names are defined as enumeration using the
  keyword "enum" (PowerShell 5 or better)
  
  The raw value(s) are translated to friendly text by 
  simply converting them into the enum type.
  
  Note: to use other properties than "Win32_SystemEnclosure", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumSecurityBreach
{
  Other               = 1
  Unknown             = 2
  No_Breach           = 3
  Breach_Attempted    = 4
  Breach_Successful   = 5
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -First 1

<#
  IMPORTANT: this example processes only one instance to focus on
  the number-to-text type conversion. 
  
  To process all instances, replace   "Select-Object -First 1" 
  with a "Foreach-Object" loop, and use the iterator variable 
  $_ instead of $instance
#>

# query the property:
$rawValue = $instance.SecurityBreach

#region using strict type conversion

<#
  Note: strict type conversion fails if the raw value is 
  not defined by the enum. So if the list of allowable values
  was extended and the enum does not match the value,
  an exception is thrown
#>

# convert the property to the enum **SecurityBreach** 
[EnumSecurityBreach]$rawValue 

# get a comma-separated string:
[EnumSecurityBreach]$rawValue -join ',' 
#endregion

#region using operator "-as"

<#
  Note: the operator "-as" accepts values not defined
  by the enum and returns $null instead of throwing
  an exception
#>

$rawValue -as [EnumSecurityBreach]
#endregion

Enums must cover all possible values. If SecurityBreach returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.

SecurityStatus

UINT16

Security setting for external input, for example, a keyboard, to a computer.

This value comes from the Security Status member of the System Enclosure or Chassis structure in the SMBIOS information.

SecurityStatus returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$SecurityStatus_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'None'
      4 = 'External interface locked out'
      5 = 'External interface enabled'
}
Use a switch statement
switch([int]$value)
{
  1          {'Other'}
  2          {'Unknown'}
  3          {'None'}
  4          {'External interface locked out'}
  5          {'External interface enabled'}
  default    {"$value"}
}
Use Enum structure
Enum EnumSecurityStatus
{
  Other                           = 1
  Unknown                         = 2
  None                            = 3
  External_interface_locked_out   = 4
  External_interface_enabled      = 5
}

Examples

Use $SecurityStatus_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "SecurityStatus" to friendly text

  Note: to use other properties than "SecurityStatus", look up the appropriate 
  translation hashtable for the property you would like to use instead.
#>

#region define hashtable to translate raw values to friendly text

# Please note: this hashtable is specific for property "SecurityStatus" 
# to translate other properties, use their translation table instead
$SecurityStatus_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'None'
      4 = 'External interface locked out'
      5 = 'External interface enabled'
}

#endregion define hashtable

#region define calculated property (to be used with Select-Object)

<#
  a calculated property is defined by a hashtable with keys "Name" and "Expression"
  "Name" defines the name of the property (in this example, it is "SecurityStatus", but you can rename it to anything else)
  "Expression" defines a scriptblock that calculates the content of this property
  in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
  value to its friendly text counterpart:
#>
 
$SecurityStatus = @{
  Name = 'SecurityStatus'
  Expression = {
    # property is an array, so process all values
    $value = $_.SecurityStatus
    $SecurityStatus_map[[int]$value]
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "SecurityStatus". The latter
# is defined by the hashtable in $SecurityStatus: 
Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -Property Caption, $SecurityStatus

# ...or dump content of property SecurityStatus:
$friendlyValues = Get-CimInstance -Class Win32_SystemEnclosure | 
    Select-Object -Property $SecurityStatus |
    Select-Object -ExpandProperty SecurityStatus

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $SecurityStatus_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_SystemEnclosure" to friendly text. This approach is ideal when
  there is just one instance to work with.

  Note: to use other properties than "Win32_SystemEnclosure", look up the appropriate 
  translation hashtable for the property you would like to use instead.
#>

#region define hashtable to translate raw values to friendly text

# Please note: this hashtable is specific for property "Win32_SystemEnclosure" 
# to translate other properties, use their translation table instead
$SecurityStatus_map = @{
      1 = 'Other'
      2 = 'Unknown'
      3 = 'None'
      4 = 'External interface locked out'
      5 = 'External interface enabled'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -First 1

<#
  IMPORTANT: this example processes only one instance to illustrate
  the number-to-text translation. To process all instances, replace
  "Select-Object -First 1" with a "Foreach-Object" loop, and use
  the iterator variable $_ instead of $instance
#>

# query the property
$rawValue = $instance.SecurityStatus  

# translate raw value to friendly text:
$friendlyName = $SecurityStatus_map[[int]$rawValue]

# output value
$friendlyName
Use a switch statement inside a calculated property for Select-Object
<# 
  this example uses a switch clause to translate raw numeric 
  values for property "SecurityStatus" to friendly text. The switch
  clause is embedded into a calculated property so there is
  no need to refer to external variables for translation.

  Note: to use other properties than "SecurityStatus", look up the appropriate 
  translation switch clause for the property you would like to use instead.
#>

#region define calculated property (to be used with Select-Object)

<#
  a calculated property is defined by a hashtable with keys "Name" and "Expression"
  "Name" defines the name of the property (in this example, it is "SecurityStatus", but you can rename it to anything else)
  "Expression" defines a scriptblock that calculates the content of this property
  in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
  value to its friendly text counterpart:
#>
 
$SecurityStatus = @{
  Name = 'SecurityStatus'
  Expression = {
    # property is an array, so process all values
    $value = $_.SecurityStatus
    
    switch([int]$value)
      {
        1          {'Other'}
        2          {'Unknown'}
        3          {'None'}
        4          {'External interface locked out'}
        5          {'External interface enabled'}
        default    {"$value"}
      }
      
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_SystemEnclosure | 
  # ...and output properties "Caption" and "SecurityStatus". The latter is defined
  # by the hashtable in $SecurityStatus:
  Select-Object -Property Caption, $SecurityStatus
Use the Enum from above to auto-translate the code values
<# 
  this example translates raw values by means of type conversion
  the friendly names are defined as enumeration using the
  keyword "enum" (PowerShell 5 or better)
  
  The raw value(s) are translated to friendly text by 
  simply converting them into the enum type.
  
  Note: to use other properties than "Win32_SystemEnclosure", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumSecurityStatus
{
  Other                           = 1
  Unknown                         = 2
  None                            = 3
  External_interface_locked_out   = 4
  External_interface_enabled      = 5
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -First 1

<#
  IMPORTANT: this example processes only one instance to focus on
  the number-to-text type conversion. 
  
  To process all instances, replace   "Select-Object -First 1" 
  with a "Foreach-Object" loop, and use the iterator variable 
  $_ instead of $instance
#>

# query the property:
$rawValue = $instance.SecurityStatus

#region using strict type conversion

<#
  Note: strict type conversion fails if the raw value is 
  not defined by the enum. So if the list of allowable values
  was extended and the enum does not match the value,
  an exception is thrown
#>

# convert the property to the enum **SecurityStatus** 
[EnumSecurityStatus]$rawValue 

# get a comma-separated string:
[EnumSecurityStatus]$rawValue -join ',' 
#endregion

#region using operator "-as"

<#
  Note: the operator "-as" accepts values not defined
  by the enum and returns $null instead of throwing
  an exception
#>

$rawValue -as [EnumSecurityStatus]
#endregion

Enums must cover all possible values. If SecurityStatus returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.

SerialNumber

STRING MAX 64 CHAR

Manufacturer-allocated number used to identify the physical element.

This value comes from the Serial Number member of the System Enclosure or Chassis structure in the SMBIOS information.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, SerialNumber

ServiceDescriptions

STRING ARRAY

Array of more detailed explanations for any of the entries in the ServicePhilosophy array. Be aware that each entry of this array is related to the entry in ServicePhilosophy that is located at the same index.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, ServiceDescriptions

ServicePhilosophy

UINT16 ARRAY

Array that includes whether the frame is serviced from the top, front, back, or side, whether the frame has sliding trays or removable sides, and whether the frame is moveable—for example, having rollers.

ServicePhilosophy returns a numeric value. To translate it into a meaningful text, use any of the following approaches:

Use a PowerShell Hashtable
$ServicePhilosophy_map = @{
      0 = 'Unknown'
      1 = 'Other'
      2 = 'Service From Top'
      3 = 'Service From Front'
      4 = 'Service From Back'
      5 = 'Service From Side'
      6 = 'Sliding Trays'
      7 = 'Removable Sides'
      8 = 'Moveable'
}
Use a switch statement
switch([int]$value)
{
  0          {'Unknown'}
  1          {'Other'}
  2          {'Service From Top'}
  3          {'Service From Front'}
  4          {'Service From Back'}
  5          {'Service From Side'}
  6          {'Sliding Trays'}
  7          {'Removable Sides'}
  8          {'Moveable'}
  default    {"$value"}
}
Use Enum structure
Enum EnumServicePhilosophy
{
  Unknown              = 0
  Other                = 1
  Service_From_Top     = 2
  Service_From_Front   = 3
  Service_From_Back    = 4
  Service_From_Side    = 5
  Sliding_Trays        = 6
  Removable_Sides      = 7
  Moveable             = 8
}

Examples

Use $ServicePhilosophy_map in a calculated property for Select-Object
<# 
  this example uses a hashtable to translate raw numeric values for 
  property "ServicePhilosophy" to friendly text

  Note: to use other properties than "ServicePhilosophy", look up the appropriate 
  translation hashtable for the property you would like to use instead.
#>

#region define hashtable to translate raw values to friendly text

# Please note: this hashtable is specific for property "ServicePhilosophy" 
# to translate other properties, use their translation table instead
$ServicePhilosophy_map = @{
      0 = 'Unknown'
      1 = 'Other'
      2 = 'Service From Top'
      3 = 'Service From Front'
      4 = 'Service From Back'
      5 = 'Service From Side'
      6 = 'Sliding Trays'
      7 = 'Removable Sides'
      8 = 'Moveable'
}

#endregion define hashtable

#region define calculated property (to be used with Select-Object)

<#
  a calculated property is defined by a hashtable with keys "Name" and "Expression"
  "Name" defines the name of the property (in this example, it is "ServicePhilosophy", but you can rename it to anything else)
  "Expression" defines a scriptblock that calculates the content of this property
  in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
  value to its friendly text counterpart:
#>
 
$ServicePhilosophy = @{
  Name = 'ServicePhilosophy'
  Expression = {
    # property is an array, so process all values
    $result = foreach($value in $_.ServicePhilosophy)
    {
        # important: convert original value to [int] because
        # hashtable keys are type-aware:
        $ServicePhilosophy_map[[int]$value]
    }
    # uncomment to get a comma-separated string instead
    # of a string array:
    $result <#-join ', '#>
  }  
}
#endregion define calculated property

# retrieve the instances, and output the properties "Caption" and "ServicePhilosophy". The latter
# is defined by the hashtable in $ServicePhilosophy: 
Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -Property Caption, $ServicePhilosophy

# ...or dump content of property ServicePhilosophy:
$friendlyValues = Get-CimInstance -Class Win32_SystemEnclosure | 
    Select-Object -Property $ServicePhilosophy |
    Select-Object -ExpandProperty ServicePhilosophy

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use $ServicePhilosophy_map to directly translate raw values from an instance
<# 
  this example uses a hashtable to manually translate raw numeric values 
  for property "Win32_SystemEnclosure" to friendly text. This approach is ideal when there
  is just one instance to work with.

  Note: to use other properties than "Win32_SystemEnclosure", look up the appropriate 
  translation hashtable for the property you would like to use instead.
#>

#region define hashtable to translate raw values to friendly text

# Please note: this hashtable is specific for property "Win32_SystemEnclosure" 
# to translate other properties, use their translation table instead
$ServicePhilosophy_map = @{
      0 = 'Unknown'
      1 = 'Other'
      2 = 'Service From Top'
      3 = 'Service From Front'
      4 = 'Service From Back'
      5 = 'Service From Side'
      6 = 'Sliding Trays'
      7 = 'Removable Sides'
      8 = 'Moveable'
}

#endregion define hashtable

# get one instance:
$instance = Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -First 1

<#
  IMPORTANT: this example processes only one instance to illustrate
  the number-to-text translation. To process all instances, replace
  "Select-Object -First 1" with a "Foreach-Object" loop, and use
  the iterator variable $_ instead of $instance
#>

# query the property (hint: the property is an array!)
$rawValues = $instance.ServicePhilosophy  

# translate all raw values into friendly names:
$friendlyNames = foreach($rawValue in $rawValues)
{ $ServicePhilosophy_map[[int]$rawValue] }

# output values
$friendlyValues

# output values as comma separated list
$friendlyValues -join ', '

# output values as bullet list
$friendlyValues | ForEach-Object { "- $_" }
Use a switch statement inside a calculated property for Select-Object
<# 
  this example uses a switch clause to translate raw numeric 
  values for property "ServicePhilosophy" to friendly text. The switch
  clause is embedded into a calculated property so there is
  no need to refer to external variables for translation.

  Note: to use other properties than "ServicePhilosophy", look up the appropriate 
  translation switch clause for the property you would like to use instead.
#>

#region define calculated property (to be used with Select-Object)

<#
  a calculated property is defined by a hashtable with keys "Name" and "Expression"
  "Name" defines the name of the property (in this example, it is "ServicePhilosophy", but you can rename it to anything else)
  "Expression" defines a scriptblock that calculates the content of this property
  in this example, the scriptblock uses the hashtable defined earlier to translate each numeric
  value to its friendly text counterpart:
#>
 
$ServicePhilosophy = @{
  Name = 'ServicePhilosophy'
  Expression = {
    # property is an array, so process all values
    $result = foreach($value in $_.ServicePhilosophy)
    {
        switch([int]$value)
      {
        0          {'Unknown'}
        1          {'Other'}
        2          {'Service From Top'}
        3          {'Service From Front'}
        4          {'Service From Back'}
        5          {'Service From Side'}
        6          {'Sliding Trays'}
        7          {'Removable Sides'}
        8          {'Moveable'}
        default    {"$value"}
      }
      
    }
    $result
  }  
}
#endregion define calculated property

# retrieve all instances...
Get-CimInstance -ClassName Win32_SystemEnclosure | 
  # ...and output properties "Caption" and "ServicePhilosophy". The latter is defined
  # by the hashtable in $ServicePhilosophy:
  Select-Object -Property Caption, $ServicePhilosophy
Use the Enum from above to auto-translate the code values
<# 
  this example translates raw values by means of type conversion
  the friendly names are defined as enumeration using the
  keyword "enum" (PowerShell 5 or better)
  
  The raw value(s) are translated to friendly text by 
  simply converting them into the enum type.
  
  Note: to use other properties than "Win32_SystemEnclosure", look up the appropriate 
  enum definition for the property you would like to use instead.
#>


#region define enum with value-to-text translation:
Enum EnumServicePhilosophy
{
  Unknown              = 0
  Other                = 1
  Service_From_Top     = 2
  Service_From_Front   = 3
  Service_From_Back    = 4
  Service_From_Side    = 5
  Sliding_Trays        = 6
  Removable_Sides      = 7
  Moveable             = 8
}

#endregion define enum

# get one instance:
$instance = Get-CimInstance -Class Win32_SystemEnclosure | Select-Object -First 1

<#
  IMPORTANT: this example processes only one instance to focus on
  the number-to-text type conversion. 
  
  To process all instances, replace   "Select-Object -First 1" 
  with a "Foreach-Object" loop, and use the iterator variable 
  $_ instead of $instance
#>

# query the property:
$rawValue = $instance.ServicePhilosophy

#region using strict type conversion

<#
  Note: strict type conversion fails if the raw value is 
  not defined by the enum. So if the list of allowable values
  was extended and the enum does not match the value,
  an exception is thrown
#>

# convert the property to the enum **ServicePhilosophy** 
[EnumServicePhilosophy[]]$rawValue 

# get a comma-separated string:
[EnumServicePhilosophy[]]$rawValue -join ',' 
#endregion

#region using operator "-as"

<#
  Note: the operator "-as" accepts values not defined
  by the enum and returns $null instead of throwing
  an exception
#>

$rawValue -as [EnumServicePhilosophy[]]
#endregion

Enums must cover all possible values. If ServicePhilosophy returns a value that is not defined in the enum, an exception occurs. The exception reports the value that was missing in the enum. To fix, add the missing value to the enum.

SKU

STRING MAX 64 CHAR

Stock keeping unit number for the physical element.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, SKU

SMBIOSAssetTag

STRING

Asset tag number of the system enclosure.

This value comes from the Asset Tag Number member of the System Enclosure or Chassis structure in the SMBIOS information.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, SMBIOSAssetTag

Status

STRING MAX 10 CHAR

Current status of an object. Various operational and nonoperational statuses can be defined. Available values:

$values = 'Degraded','Error','Lost Comm','No Contact','NonRecover','OK','Pred Fail','Service','Starting','Stopping','Stressed','Unknown'
Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Status

Tag

KEY PROPERTY STRING MAX 256 CHAR

Unique identifier of the system enclosure.

Example: “System Enclosure 1”

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag

TypeDescriptions

STRING ARRAY

Array of more information about the ChassisTypes array entries. Be aware that each entry of this array is related to the entry in ChassisTypes that is located at the same index.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, TypeDescriptions

Version

STRING MAX 64 CHAR

Version of the physical element.

This value comes from the Version member of the System Enclosure or Chassis structure in the SMBIOS information.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Version

VisibleAlarm

BOOLEAN

If TRUE, the equipment includes a visible alarm.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, VisibleAlarm

Weight

REAL32 “POUNDS”

Weight of the physical package in pounds.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Weight

Width

REAL32 “INCHES”

Width of the physical package in inches.

Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property Tag, Width

Examples

List all instances of Win32_SystemEnclosure
Get-CimInstance -ClassName Win32_SystemEnclosure

Learn more about Get-CimInstance and the deprecated Get-WmiObject.

View all properties
Get-CimInstance -ClassName Win32_SystemEnclosure -Property *
View key properties only
Get-CimInstance -ClassName Win32_SystemEnclosure -KeyOnly

Selecting Properties

To select only some properties, pipe the results to Select-Object -Property a,b,c with a comma-separated list of the properties you require. Wildcards are permitted.

Get-CimInstance always returns all properties but only retrieves the ones that you specify. All other properties are empty but still present. That’s why you need to pipe the results into Select-Object if you want to limit the visible properties, i.e. for reporting.

Selecting Properties

The code below lists all available properties. Remove the ones you do not need:

$properties = 'AudibleAlarm',
              'BreachDescription',
              'CableManagementStrategy',
              'Caption',
              'ChassisTypes',
              'CreationClassName',
              'CurrentRequiredOrProduced',
              'Depth',
              'Description',
              'HeatGeneration',
              'Height',
              'HotSwappable',
              'InstallDate',
              'LockPresent',
              'Manufacturer',
              'Model',
              'Name',
              'NumberOfPowerCords',
              'OtherIdentifyingInfo',
              'PartNumber',
              'PoweredOn',
              'Removable',
              'Replaceable',
              'SecurityBreach',
              'SecurityStatus',
              'SerialNumber',
              'ServiceDescriptions',
              'ServicePhilosophy',
              'SKU',
              'SMBIOSAssetTag',
              'Status',
              'Tag',
              'TypeDescriptions',
              'Version',
              'VisibleAlarm',
              'Weight',
              'Width'
Get-CimInstance -ClassName Win32_SystemEnclosure | Select-Object -Property $properties
Limiting Network Bandwidth

If you work remotely, it makes sense to limit network bandwidth by filtering the properties on the server side, too:

Get-CimInstance -Class Win32_SystemEnclosure -Property $property | 
Select-Object -Property $property

Selecting Instances

To select some instances, use Get-CimInstance and a WMI Query. The wildcard character in WMI Queries is % (and not “*”).

The parameter -Filter runs a simple query.

Listing all instances where the property Caption starts with “A”
Get-CimInstance -Class Win32_SystemEnclosure -Filter 'Caption LIKE "a%"' 
Using a WQL Query

The parameter -Query uses a query similar to SQL and combines the parameters -Filter and -Property. This returns all instances where the property Caption starts with “A”, and returns the properties specified:

Get-CimInstance -Query "SELECT SerialNumber, HotSwappable, Caption, Replaceable FROM Win32_SystemEnclosure WHERE Caption LIKE 'a%'"

Any property you did not specify is still present but empty. You might need to use Select-Object to remove all unwanted properties:

Get-CimInstance -Query "SELECT SerialNumber, HotSwappable, Caption, Replaceable FROM Win32_SystemEnclosure WHERE Caption LIKE 'a%'" | Select-Object -Property SerialNumber, HotSwappable, Caption, Replaceable

Accessing Remote Computers

To access remote systems, you need to have proper permissions. User the parameter -ComputerName to access one or more remote systems.

Authenticating as Current User
# one or more computer names or IP addresses:
$list = 'server1', 'server2'

# authenticate with your current identity:
$result = Get-CimInstance -ClassName Win32_SystemEnclosure -ComputerName $list 
$result
Authenticating as Different User

Use a CIMSession object to authenticate with a new identity:

# one or more computer names or IP addresses:
$list = 'server1', 'server2'

# authenticate with a different identity:
$cred = Get-Credential -Message 'Authenticate to retrieve WMI information:'
$session = New-CimSession -ComputerName $list -Credential $cred

$result = Get-CimInstance Win32_SystemEnclosure -CimSession $session

# remove the session after use (if you do not plan to re-use it later)
Remove-CimSession -CimSession $session

$result

Learn more about accessing remote computers.

Requirements

To use Win32_SystemEnclosure, the following requirements apply:

PowerShell

Get-CimInstance was introduced with PowerShell Version 3.0, which in turn was introduced on clients with Windows 8 and on servers with Windows Server 2012.

If necessary, update Windows PowerShell to Windows PowerShell 5.1, or install PowerShell 7 side-by-side.

Operating System

Win32_SystemEnclosure was introduced on clients with Windows Vista and on servers with Windows Server 2008.

Namespace

Win32_SystemEnclosure lives in the Namespace Root/CIMV2. This is the default namespace. There is no need to use the -Namespace parameter in Get-CimInstance.

Implementation

Win32_SystemEnclosure is implemented in CIMWin32.dll and defined in CIMWin32.mof. Both files are located in the folder C:\Windows\system32\wbem:

explorer $env:windir\system32\wbem
notepad $env:windir\system32\wbem\CIMWin32.mof