Examples
There is always exactly one instance of Win32_ComputerSystem representing your physical computer and the installation of your Windows operating system on it:
Get-CimInstance -ClassName Win32_ComputerSystem
By default, PowerShell returns a subset of all available properties:
Name PrimaryOwnerName Domain TotalPhysicalMemory Model Manufacturer
---- ---------------- ------ ------------------- ----- ------------
DELL7390 [email protected] WORKGROUP 34116243456 XPS 13 7390 2-in-1 Dell Inc.
To view all available properties, use Select-Object
. This command returns all available properties:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property *
Sample results
AdminPasswordStatus : 2
BootupState : Normal boot
ChassisBootupState : 3
KeyboardPasswordStatus : 2
PowerOnPasswordStatus : 2
PowerSupplyState : 3
PowerState : 0
FrontPanelResetStatus : 2
ThermalState : 3
Status : OK
Name : DELL7390
PowerManagementCapabilities :
PowerManagementSupported :
Caption : DELL7390
Description : AT/AT COMPATIBLE
InstallDate :
CreationClassName : Win32_ComputerSystem
NameFormat :
PrimaryOwnerContact :
PrimaryOwnerName : [email protected]
Roles : {LM_Workstation, LM_Server, Print, NT...}
InitialLoadInfo :
LastLoadInfo :
ResetCapability : 1
AutomaticManagedPagefile : True
AutomaticResetBootOption : False
AutomaticResetCapability : True
BootOptionOnLimit :
BootOptionOnWatchDog :
BootROMSupported : True
BootStatus : {0, 0, 0, 39...}
ChassisSKUNumber : Convertible
CurrentTimeZone : 120
DaylightInEffect : True
DNSHostName : DELL7390
Domain : WORKGROUP
DomainRole : 0
EnableDaylightSavingsTime : True
HypervisorPresent : False
InfraredSupported : False
Manufacturer : Dell Inc.
Model : XPS 13 7390 2-in-1
NetworkServerModeEnabled : True
NumberOfLogicalProcessors : 8
NumberOfProcessors : 1
OEMLogoBitmap :
OEMStringArray : {Dell System, 1[08B0], 3[1.0], 12[www.dell.com]...}
PartOfDomain : False
PauseAfterReset : -1
PCSystemType : 2
PCSystemTypeEx : 2
ResetCount : -1
ResetLimit : -1
SupportContactDescription :
SystemFamily : XPS
SystemSKUNumber : 08B0
SystemStartupDelay :
SystemStartupOptions :
SystemStartupSetting :
SystemType : x64-based PC
TotalPhysicalMemory : 34116243456
UserName : DELL7390\tobia
WakeUpType : 6
Workgroup : WORKGROUP
PSComputerName :
CimClass : root/cimv2:Win32_ComputerSystem
CimInstanceProperties : {Caption, Description, InstallDate, Name...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
Some information is encoded and uses numeric constants. Look up individual properties below for detailed information.
From the list of all available properties, select the ones that you find interesting, for example:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property BootupState, NumberOf*, UserName
The result looks similar to this:
BootupState NumberOfLogicalProcessors NumberOfProcessors UserName
----------- ------------------------- ------------------ --------
Normal boot 8 1 DELL7390\tobia
Some properties contain arrays. Use Select-Object -ExpandProperty
to unpack the array elements:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty OEMStringArray
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Roles
Decoding Numeric Information
A great number of properties use numeric constants.
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property AdminPasswordStatus, KeyboardPasswordStatus, ChassisBootupState, PowerOnPasswordStatus, PowerSupplyState, PowerState, FrontPanelResetStatus, ThermalState, ResetCapabilities, PCSystemType, PCSystemTypeEx, WakeUpType, TotalPhysicalMemory
When you dump the raw information, it is unclear what the numeric constants stand for:
AdminPasswordStatus : 2
KeyboardPasswordStatus : 2
ChassisBootupState : 3
PowerOnPasswordStatus : 2
PowerSupplyState : 3
PowerState : 0
FrontPanelResetStatus : 2
ThermalState : 3
DomainRole : 0
PCSystemType : 2
PCSystemTypeEx : 2
WakeUpType : 6
TotalPhysicalMemory : 34116243456
When you extend the type system and run the list of Update-Type
statements, the numeric constants are automatically translated to friendly text:
AdminPasswordStatus : Not_Implemented
KeyboardPasswordStatus : Not_Implemented
ChassisBootupState : Safe
PowerOnPasswordStatus : Not_implemented
PowerSupplyState : Safe
PowerState : Unknown
FrontPanelResetStatus : Not_Implemented
ThermalState : Safe
DomainRole : Standalone_Workstation
PCSystemType : Mobile
PCSystemTypeEx : Mobile
WakeUpType : Power_Switch
TotalPhysicalMemory : 31,8 GB
Currently Logged On User
The property UserName returns the user currently logged on to session 0. This session is the interactive session on the physical computer:
$user = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty UserName
$LoggedOn = $user -ne ''
"Someone logged on to physical machine: $LoggedOn"
"Logged on to Session 0: $user"
This property is empty when no user is logged on to the physical machine. When the property is empty, there can still be users logged on via terminal server or virtual sessions.
The result looks similar to this:
Someone logged on to physical machine: True
Logged on to Session 0: DELL7390\tobia
Remote Access
To access remote system(s), use the parameter -ComputerName:
Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName webserver12
Learn more about accessing remote computers.
Removing Empty Properties
To eliminate all empty properties and show only properties with content, try this:
# get all WMI information:
$os = Get-CimInstance -ClassName Win32_ComputerSystem
# find names of non-empty properties:
$filledProperties = $os.PSObject.Properties.Name.Where{![string]::IsNullOrWhiteSpace($os.$_)} | Sort-Object
# show non-empty properties only:
$os | Select-Object -Property $filledProperties
To turn the object into a hashtable and show it in a gridview as a table, try this:
# get all WMI information:
$os = Get-CimInstance -ClassName Win32_ComputerSystem
# find names of non-empty properties:
$filledProperties = $os.PSObject.Properties.Name.Where{![string]::IsNullOrWhiteSpace($os.$_)} | Sort-Object
# turn object into hashtable and show in gridview
$filledProperties | ForEach-Object { $hash = [Ordered]@{} } { $hash[$_] = $os.$_ } { $hash } | Out-GridView
When you convert an object into a hashtable, the gridview shows one property per line, and you can now use the text filter box on top of the gridview to easily filter and search for information. This technique can generally be useful when visualizing exactly one object.
Methods
Win32_ComputerSystem has 3 methods:
Method | Description |
---|---|
JoinDomainOrWorkgroup | Adds a computer system to a domain or workgroup. |
Rename | Renames a local computer. |
UnjoinDomainOrWorkgroup | Removes a computer system from a domain or workgroup. |
Learn more about Invoke-CimMethod
and how to invoke commands. Click any of the methods listed above to learn more about their purpose, parameters, and return value.
Properties
Win32_ComputerSystem returns 64 properties:
'AdminPasswordStatus','AutomaticManagedPagefile','AutomaticResetBootOption',
'AutomaticResetCapability','BootOptionOnLimit','BootOptionOnWatchDog','BootROMSupported','BootStatus',
'BootupState','Caption','ChassisBootupState','ChassisSKUNumber','CreationClassName',
'CurrentTimeZone','DaylightInEffect','Description','DNSHostName','Domain','DomainRole',
'EnableDaylightSavingsTime','FrontPanelResetStatus','HypervisorPresent','InfraredSupported','InitialLoadInfo',
'InstallDate','KeyboardPasswordStatus','LastLoadInfo','Manufacturer','Model','Name','NameFormat',
'NetworkServerModeEnabled','NumberOfLogicalProcessors','NumberOfProcessors','OEMLogoBitmap','OEMStringArray',
'PartOfDomain','PauseAfterReset','PCSystemType','PCSystemTypeEx','PowerManagementCapabilities',
'PowerManagementSupported','PowerOnPasswordStatus','PowerState','PowerSupplyState','PrimaryOwnerContact',
'PrimaryOwnerName','ResetCapability','ResetCount','ResetLimit','Roles','Status',
'SupportContactDescription','SystemFamily','SystemSKUNumber','SystemStartupDelay','SystemStartupOptions',
'SystemStartupSetting','SystemType','ThermalState','TotalPhysicalMemory','UserName','WakeUpType','Workgroup'
Unless explicitly marked as WRITEABLE, all properties are read-only.
AdminPasswordStatus
System hardware security settings for administrator password status.
AdminPasswordStatus returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName AdminPasswordStatus -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumAdminPasswordStatus
{
Disabled = 0
Enabled = 1
NotImplemented = 2
Unknown = 3
}
[EnumAdminPasswordStatus]($this.PSBase.CimInstanceProperties['AdminPasswordStatus'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, AdminPasswordStatus
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$AdminPasswordStatus = @{
Name = 'AdminPasswordStatusText'
Expression = {
$value = $_.AdminPasswordStatus
switch([int]$value)
{
0 {'Disabled'}
1 {'Enabled'}
2 {'NotImplemented'}
3 {'Unknown'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, AdminPasswordStatus, $AdminPasswordStatus
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$AdminPasswordStatus_map = @{
0 = 'Disabled'
1 = 'Enabled'
2 = 'NotImplemented'
3 = 'Unknown'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumAdminPasswordStatus
{
Disabled = 0
Enabled = 1
NotImplemented = 2
Unknown = 3
}
AutomaticManagedPagefile
If $true
, the size of the page file is managed automatically by the operating system.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, AutomaticManagedPagefile
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty AutomaticManagedPagefile
"AutomaticManagedPagefile = $value"
AutomaticResetBootOption
If $true
, the system boots automatically after a crash.
This setting is controlled by the registry value AutoReboot in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, AutomaticResetBootOption
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty AutomaticResetBootOption
"AutomaticResetBootOption = $value"
AutomaticResetCapability
If $true
, the automatic reset is enabled.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, AutomaticResetCapability
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty AutomaticResetCapability
"AutomaticResetCapability = $value"
BootOptionOnLimit
Identifies the system action when the ResetLimit value is reached. This is a feature managed by the system bios. WMI just exposes the current BIOS setting but won’t allow changes.
BootOptionOnLimit returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName BootOptionOnLimit -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumBootOptionOnLimit
{
Reserved = 0
OperatingSystem = 1
SystemUtilities = 2
DoNotReboot = 3
}
[EnumBootOptionOnLimit]($this.PSBase.CimInstanceProperties['BootOptionOnLimit'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, BootOptionOnLimit
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$BootOptionOnLimit = @{
Name = 'BootOptionOnLimitText'
Expression = {
$value = $_.BootOptionOnLimit
switch([int]$value)
{
0 {'Reserved'}
1 {'OperatingSystem'}
2 {'SystemUtilities'}
3 {'DoNotReboot'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, BootOptionOnLimit, $BootOptionOnLimit
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$BootOptionOnLimit_map = @{
0 = 'Reserved'
1 = 'OperatingSystem'
2 = 'SystemUtilities'
3 = 'DoNotReboot'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumBootOptionOnLimit
{
Reserved = 0
OperatingSystem = 1
SystemUtilities = 2
DoNotReboot = 3
}
BootOptionOnWatchDog
Type of reboot action after the time on the watchdog timer is elapsed.
BootOptionOnWatchDog returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName BootOptionOnWatchDog -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumBootOptionOnWatchDog
{
Reserved = 0
OperatingSystem = 1
SystemUtilities = 2
DoNotReboot = 3
}
[EnumBootOptionOnWatchDog]($this.PSBase.CimInstanceProperties['BootOptionOnWatchDog'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, BootOptionOnWatchDog
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$BootOptionOnWatchDog = @{
Name = 'BootOptionOnWatchDogText'
Expression = {
$value = $_.BootOptionOnWatchDog
switch([int]$value)
{
0 {'Reserved'}
1 {'OperatingSystem'}
2 {'SystemUtilities'}
3 {'DoNotReboot'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, BootOptionOnWatchDog, $BootOptionOnWatchDog
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$BootOptionOnWatchDog_map = @{
0 = 'Reserved'
1 = 'OperatingSystem'
2 = 'SystemUtilities'
3 = 'DoNotReboot'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumBootOptionOnWatchDog
{
Reserved = 0
OperatingSystem = 1
SystemUtilities = 2
DoNotReboot = 3
}
BootROMSupported
If $true
, indicates whether a boot ROM is supported.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, BootROMSupported
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty BootROMSupported
"BootROMSupported = $value"
BootStatus
Status and Additional Data fields that identify the boot status.
This value comes from the Boot Status member of the System Boot Information structure in the SMBIOS information.
This property is not supported before Windows 10 and Windows Server 2016.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, BootStatus
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty BootStatus
"BootStatus = $value"
BootupState
System is started. Fail-safe boot bypasses the user startup files also called SafeBoot.
Available values:
'Normal boot'', ''Fail-safe boot'', ''Fail-safe with network boot''
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, BootupState
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty BootupState
"BootupState = $value"
Caption
Short description of the object a one-line string.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, Caption
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Caption
"Caption = $value"
ChassisBootupState
Boot up state of the chassis.
This value comes from the Boot-up State member of the System Enclosure or Chassis structure in the SMBIOS information.
ChassisBootupState returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName ChassisBootupState -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumChassisBootupState
{
Other = 1
Unknown = 2
Safe = 3
Warning = 4
Critical = 5
Non_recoverable = 6
}
[EnumChassisBootupState]($this.PSBase.CimInstanceProperties['ChassisBootupState'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ChassisBootupState
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$ChassisBootupState = @{
Name = 'ChassisBootupStateText'
Expression = {
$value = $_.ChassisBootupState
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Safe'}
4 {'Warning'}
5 {'Critical'}
6 {'Non-recoverable'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ChassisBootupState, $ChassisBootupState
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$ChassisBootupState_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Safe'
4 = 'Warning'
5 = 'Critical'
6 = 'Non-recoverable'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumChassisBootupState
{
Other = 1
Unknown = 2
Safe = 3
Warning = 4
Critical = 5
Non_recoverable = 6
}
ChassisSKUNumber
The chassis or enclosure SKU number as a string.
This value comes from the SKU Number member of the System Enclosure or Chassis structure in the SMBIOS information.
This property is not supported before Windows 10 and Windows Server 2016.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ChassisSKUNumber
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty ChassisSKUNumber
"ChassisSKUNumber = $value"
CreationClassName
Name of the first concrete class in the inheritance chain of an instance. You can use this property with other properties of the class to identify all instances of the class and its subclasses.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, CreationClassName
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty CreationClassName
"CreationClassName = $value"
CurrentTimeZone
Amount of time the unitary computer system is offset from Coordinated Universal Time (UTC).
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, CurrentTimeZone
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty CurrentTimeZone
"CurrentTimeZone = ${value} minutes"
DaylightInEffect
If $true
, the daylight savings mode is ON.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, DaylightInEffect
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty DaylightInEffect
"DaylightInEffect = $value"
Description
Description of the object.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, Description
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Description
"Description = $value"
DNSHostName
Name of local computer according to the domain name server (DNS).
This information is produced by the Windows API method GetComputerNameEx().
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, DNSHostName
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty DNSHostName
"DNSHostName = $value"
Domain
Name of the domain to which a computer belongs.
If the computer is not part of a domain, then the name of the workgroup is returned.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, Domain
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Domain
"Domain = $value"
DomainRole
Role of a computer in an Active Directory environment. Domain controllers render important infrastructure services and are especially security-critical.
DomainRole returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName DomainRole -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumDomainRole
{
Standalone_Workstation_ = 0
Member_Workstation = 1
Standalone_Server = 2
Member_Server_ = 3
Backup_Domain_Controller_ = 4
Primary_Domain_Controller = 5
}
[EnumDomainRole]($this.PSBase.CimInstanceProperties['DomainRole'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, DomainRole
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$DomainRole = @{
Name = 'DomainRoleText'
Expression = {
$value = $_.DomainRole
switch([int]$value)
{
0 {'Standalone_Workstation '}
1 {'Member_Workstation'}
2 {'Standalone_Server'}
3 {'Member_Server '}
4 {'Backup_Domain_Controller '}
5 {'Primary_Domain_Controller'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, DomainRole, $DomainRole
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$DomainRole_map = @{
0 = 'Standalone_Workstation '
1 = 'Member_Workstation'
2 = 'Standalone_Server'
3 = 'Member_Server '
4 = 'Backup_Domain_Controller '
5 = 'Primary_Domain_Controller'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumDomainRole
{
Standalone_Workstation_ = 0
Member_Workstation = 1
Standalone_Server = 2
Member_Server_ = 3
Backup_Domain_Controller_ = 4
Primary_Domain_Controller = 5
}
EnableDaylightSavingsTime
Enables daylight savings time (DST) on a computer. A value of $true
indicates that the system time changes to an hour ahead or behind when DST starts or ends. A value of $false
indicates that the system time does not change to an hour ahead or behind when DST starts or ends. A value of NULL indicates that the DST status is unknown on a system.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, EnableDaylightSavingsTime
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty EnableDaylightSavingsTime
"EnableDaylightSavingsTime = $value"
FrontPanelResetStatus
The following table lists the hardware security settings for the reset button on a computer.
FrontPanelResetStatus returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName FrontPanelResetStatus -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumFrontPanelResetStatus
{
Disabled = 0
Enabled = 1
Not_Implemented = 2
Unknown = 3
}
[EnumFrontPanelResetStatus]($this.PSBase.CimInstanceProperties['FrontPanelResetStatus'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, FrontPanelResetStatus
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$FrontPanelResetStatus = @{
Name = 'FrontPanelResetStatusText'
Expression = {
$value = $_.FrontPanelResetStatus
switch([int]$value)
{
0 {'Disabled'}
1 {'Enabled'}
2 {'Not_Implemented'}
3 {'Unknown'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, FrontPanelResetStatus, $FrontPanelResetStatus
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$FrontPanelResetStatus_map = @{
0 = 'Disabled'
1 = 'Enabled'
2 = 'Not_Implemented'
3 = 'Unknown'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumFrontPanelResetStatus
{
Disabled = 0
Enabled = 1
Not_Implemented = 2
Unknown = 3
}
HypervisorPresent
If $true
, a hypervisor is present.
This property is not supported before Windows 8 and Windows Server 2012.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, HypervisorPresent
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty HypervisorPresent
"HypervisorPresent = $value"
InfraredSupported
If $true
, an infrared (IR) port exists on a computer system.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, InfraredSupported
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty InfraredSupported
"InfraredSupported = $value"
InitialLoadInfo
Data required to find the initial load device or boot service to request that the operating system start up.
This property is typically empty.
InstallDate
This property is inherited and typically empty.
KeyboardPasswordStatus
System hardware security settings for Keyboard Password Status.
KeyboardPasswordStatus returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName KeyboardPasswordStatus -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumKeyboardPasswordStatus
{
Disabled = 0
Enabled = 1
Not_Implemented = 2
Unknown = 3
}
[EnumKeyboardPasswordStatus]($this.PSBase.CimInstanceProperties['KeyboardPasswordStatus'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, KeyboardPasswordStatus
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$KeyboardPasswordStatus = @{
Name = 'KeyboardPasswordStatusText'
Expression = {
$value = $_.KeyboardPasswordStatus
switch([int]$value)
{
0 {'Disabled'}
1 {'Enabled'}
2 {'Not_Implemented'}
3 {'Unknown'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, KeyboardPasswordStatus, $KeyboardPasswordStatus
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$KeyboardPasswordStatus_map = @{
0 = 'Disabled'
1 = 'Enabled'
2 = 'Not_Implemented'
3 = 'Unknown'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumKeyboardPasswordStatus
{
Disabled = 0
Enabled = 1
Not_Implemented = 2
Unknown = 3
}
LastLoadInfo
Array entry of the InitialLoadInfo property that contains the data to start the loaded operating system.
This property is typically empty.
Manufacturer
Name of a computer manufacturer.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, Manufacturer
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Manufacturer
"Manufacturer = $value"
Model
Product name that a manufacturer gives to a computer. This property must have a value.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, Model
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Model
"Model = $value"
Name
Name of system. This is the key property.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Name
"Name = $value"
NameFormat
Computer system Name value that is generated automatically. The CIM_ComputerSystem object and its derivatives are top-level objects of the Common Information Model (CIM). They provide the scope for several components. Unique CIM_System keys are required, but you can define a heuristic to create the CIM_ComputerSystem name that generates the same name, and is independent from the discovery protocol. This prevents inventory and management problems when the same asset or entity is discovered multiple times, but cannot be resolved to one object. Using a heuristic is recommended, but not required.
The heuristic is outlined in the CIM V2 Common Model specification, and assumes that the documented rules are used to determine and assign a name. The NameFormat values list defines the order to assign a computer system name. Several rules map to the same value.
The CIM_ComputerSystem Name value that is calculated using the heuristic is the key value of the system. However, use aliases to assign a different name for CIM_ComputerSystem, which can be more unique to your company.Available values:
'IP', 'Dial', 'HID', 'NWA', 'HWA', 'X25', 'ISDN', 'IPX', 'DCC', 'ICD', 'E164', 'SNA', 'OID_OSI', 'Other'
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, NameFormat
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty NameFormat
"NameFormat = $value"
NetworkServerModeEnabled
If $true
, the network Server Mode is enabled.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, NetworkServerModeEnabled
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty NetworkServerModeEnabled
"NetworkServerModeEnabled = $value"
NumberOfLogicalProcessors
Number of logical processors available on the computer.
You can use NumberOfLogicalProcessors and NumberOfProcessors to determine if the computer is hyperthreading. For more information, see Remarks.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, NumberOfLogicalProcessors
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty NumberOfLogicalProcessors
"NumberOfLogicalProcessors = $value"
NumberOfProcessors
Number of physical processors currently available on a system. This is the number of enabled processors for a system, which does not include the disabled processors. If a computer system has two physical processors each containing two logical processors, then the value of NumberOfProcessors is 2 and NumberOfLogicalProcessors is 4. The processors may be multicore or they may be hyperthreading processors. For more information, see Remarks.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, NumberOfProcessors
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty NumberOfProcessors
"NumberOfProcessors = $value"
OEMLogoBitmap
List of data for a bitmap that the original equipment manufacturer (OEM) creates.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, OEMLogoBitmap
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty OEMLogoBitmap
"OEMLogoBitmap = $value"
OEMStringArray
List of free-form strings that an OEM defines. For example, an OEM defines the part numbers for system reference documents, manufacturer contact information, and so on.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, OEMStringArray
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty OEMStringArray
"OEMStringArray = $value"
PartOfDomain
If $true
, the computer is part of a domain. If the value is NULL, the computer is not in a domain or the status is unknown. If you remove the computer from a domain, the value becomes false.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PartOfDomain
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty PartOfDomain
"PartOfDomain = $value"
PauseAfterReset
Time delay before a reboot is initiated in milliseconds. It is used after a system power cycle, local or remote system reset, and automatic system reset. A value of 1 (minus one) indicates that the pause value is unknown.
Windows Vista: This property may return an unknown number.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PauseAfterReset
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty PauseAfterReset
"PauseAfterReset = ${value} milliseconds"
PCSystemType
Type of the computer in use, such as laptop, desktop, or Tablet.
PCSystemType returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName PCSystemType -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPCSystemType
{
Unspecified = 0
Desktop = 1
Mobile = 2
Workstation = 3
Enterprise_Server = 4
SOHO_Server = 5
Appliance_PC = 6
Performance_Server = 7
Maximum = 8
}
[EnumPCSystemType]($this.PSBase.CimInstanceProperties['PCSystemType'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PCSystemType
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$PCSystemType = @{
Name = 'PCSystemTypeText'
Expression = {
$value = $_.PCSystemType
switch([int]$value)
{
0 {'Unspecified'}
1 {'Desktop'}
2 {'Mobile'}
3 {'Workstation'}
4 {'Enterprise Server'}
5 {'SOHO Server'}
6 {'Appliance PC'}
7 {'Performance Server'}
8 {'Maximum'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PCSystemType, $PCSystemType
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$PCSystemType_map = @{
0 = 'Unspecified'
1 = 'Desktop'
2 = 'Mobile'
3 = 'Workstation'
4 = 'Enterprise Server'
5 = 'SOHO Server'
6 = 'Appliance PC'
7 = 'Performance Server'
8 = 'Maximum'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumPCSystemType
{
Unspecified = 0
Desktop = 1
Mobile = 2
Workstation = 3
Enterprise_Server = 4
SOHO_Server = 5
Appliance_PC = 6
Performance_Server = 7
Maximum = 8
}
PCSystemTypeEx
Type of the computer in use, such as laptop, desktop, or Tablet.
This property is not supported before Windows 8.1 and Windows Server 2012 R2.
PCSystemTypeEx returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName PCSystemTypeEx -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPCSystemTypeEx
{
Unspecified = 0
Desktop = 1
Mobile = 2
Workstation = 3
Enterprise_Server = 4
SOHO_Server = 5
Appliance_PC = 6
Performance_Server = 7
Slate = 8
Maximum = 9
}
[EnumPCSystemTypeEx]($this.PSBase.CimInstanceProperties['PCSystemTypeEx'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PCSystemTypeEx
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$PCSystemTypeEx = @{
Name = 'PCSystemTypeExText'
Expression = {
$value = $_.PCSystemTypeEx
switch([int]$value)
{
0 {'Unspecified'}
1 {'Desktop'}
2 {'Mobile'}
3 {'Workstation'}
4 {'Enterprise Server'}
5 {'SOHO Server'}
6 {'Appliance PC'}
7 {'Performance Server'}
8 {'Slate'}
9 {'Maximum'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PCSystemTypeEx, $PCSystemTypeEx
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$PCSystemTypeEx_map = @{
0 = 'Unspecified'
1 = 'Desktop'
2 = 'Mobile'
3 = 'Workstation'
4 = 'Enterprise Server'
5 = 'SOHO Server'
6 = 'Appliance PC'
7 = 'Performance Server'
8 = 'Slate'
9 = 'Maximum'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumPCSystemTypeEx
{
Unspecified = 0
Desktop = 1
Mobile = 2
Workstation = 3
Enterprise_Server = 4
SOHO_Server = 5
Appliance_PC = 6
Performance_Server = 7
Slate = 8
Maximum = 9
}
PowerManagementCapabilities
Array of the specific power-related capabilities of a logical device. This property is inherited and typically empty.
PowerManagementSupported
If $true
, device can be power-managed, for example, a device can be put into suspend mode, and so on. This property does not indicate that power management features are enabled currently, but it does indicate that the logical device is capable of power management. For this class instances, the property is typically empty.
PowerOnPasswordStatus
System hardware security settings for Power-On Password Status.
PowerOnPasswordStatus returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName PowerOnPasswordStatus -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPowerOnPasswordStatus
{
Disabled = 0
Enabled = 1
Not_implemented = 2
Unknown = 3
}
[EnumPowerOnPasswordStatus]($this.PSBase.CimInstanceProperties['PowerOnPasswordStatus'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PowerOnPasswordStatus
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$PowerOnPasswordStatus = @{
Name = 'PowerOnPasswordStatusText'
Expression = {
$value = $_.PowerOnPasswordStatus
switch([int]$value)
{
0 {'Disabled'}
1 {'Enabled'}
2 {'Not implemented'}
3 {'Unknown'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PowerOnPasswordStatus, $PowerOnPasswordStatus
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$PowerOnPasswordStatus_map = @{
0 = 'Disabled'
1 = 'Enabled'
2 = 'Not implemented'
3 = 'Unknown'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumPowerOnPasswordStatus
{
Disabled = 0
Enabled = 1
Not_implemented = 2
Unknown = 3
}
PowerState
Current power state of a computer and its associated operating system. The power saving states have the following values: Value 4 (Unknown) indicates that the system is known to be in a power save mode, but its exact status in this mode is unknown; 2 (Low Power Mode) indicates that the system is in a power save state, but still functioning and may exhibit degraded performance; 3 (Standby) indicates that the system is not functioning, but could be brought to full power quickly; and 7 (Warning) indicates that the computer system is in a warning state and a power save mode.
PowerState returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName PowerState -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPowerState
{
Unknown = 0
Full_Power = 1
Power_Save_Low_Power_Mode = 2
Power_Save_Standby = 3
Power_Save_Unknown = 4
Power_Cycle = 5
Power_Off = 6
Power_Save_Warning = 7
Power_Save_Hibernate = 8
Power_Save_Soft_Off = 9
}
[EnumPowerState]($this.PSBase.CimInstanceProperties['PowerState'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PowerState
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$PowerState = @{
Name = 'PowerStateText'
Expression = {
$value = $_.PowerState
switch([int]$value)
{
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'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PowerState, $PowerState
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$PowerState_map = @{
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'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumPowerState
{
Unknown = 0
Full_Power = 1
Power_Save_Low_Power_Mode = 2
Power_Save_Standby = 3
Power_Save_Unknown = 4
Power_Cycle = 5
Power_Off = 6
Power_Save_Warning = 7
Power_Save_Hibernate = 8
Power_Save_Soft_Off = 9
}
PowerSupplyState
State of the power supply or supplies when last booted.
This value comes from the Power Supply State member of the System Enclosure or Chassis structure in the SMBIOS information.
The following list identifies the values for this property.
PowerSupplyState returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName PowerSupplyState -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPowerSupplyState
{
Other = 1
Unknown = 2
Safe = 3
Warning = 4
Critical = 5
Non_recoverable = 6
}
[EnumPowerSupplyState]($this.PSBase.CimInstanceProperties['PowerSupplyState'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PowerSupplyState
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$PowerSupplyState = @{
Name = 'PowerSupplyStateText'
Expression = {
$value = $_.PowerSupplyState
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Safe'}
4 {'Warning'}
5 {'Critical'}
6 {'Non-recoverable'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PowerSupplyState, $PowerSupplyState
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$PowerSupplyState_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Safe'
4 = 'Warning'
5 = 'Critical'
6 = 'Non-recoverable'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumPowerSupplyState
{
Other = 1
Unknown = 2
Safe = 3
Warning = 4
Critical = 5
Non_recoverable = 6
}
PrimaryOwnerContact
Contact information for the primary system owner, for example, phone number, email address, and so on.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PrimaryOwnerContact
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty PrimaryOwnerContact
"PrimaryOwnerContact = $value"
PrimaryOwnerName
Name of the primary system owner.
This value is stored in the Windows Registry in value RegisteredOwner in the key *HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion*.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, PrimaryOwnerName
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty PrimaryOwnerName
"PrimaryOwnerName = $value"
ResetCapability
If enabled, the value is 4 and the unitary computer system can be reset using the power and reset buttons. If disabled, the value is 3, and a reset is not allowed.
ResetCapability returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName ResetCapability -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumResetCapability
{
Other = 1
Unknown = 2
Disabled = 3
Enabled = 4
Not_Implemented = 5
}
[EnumResetCapability]($this.PSBase.CimInstanceProperties['ResetCapability'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ResetCapability
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$ResetCapability = @{
Name = 'ResetCapabilityText'
Expression = {
$value = $_.ResetCapability
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Disabled'}
4 {'Enabled'}
5 {'Not Implemented'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ResetCapability, $ResetCapability
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$ResetCapability_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Disabled'
4 = 'Enabled'
5 = 'Not Implemented'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumResetCapability
{
Other = 1
Unknown = 2
Disabled = 3
Enabled = 4
Not_Implemented = 5
}
ResetCount
Number of automatic resets since the last reset. A value of -1 indicates that the count is unknown.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ResetCount
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty ResetCount
"ResetCount = $value"
ResetLimit
Number of consecutive times a system reset is attempted. A value of -1 indicates that the limit is unknown.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ResetLimit
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty ResetLimit
"ResetLimit = $value"
Roles
String array that specifies the roles of a system in the IT environment.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, Roles
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Roles
"Roles = $value"
Status
Current status of an object. Various operational and nonoperational statuses can be defined.
Available values:
'Degraded','Error','Lost Comm','No Contact','NonRecover','OK','Pred Fail','Service','Starting','Stopping','Stressed','Unknown'
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, Status
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Status
"Status = $value"
SupportContactDescription
List of the support contact information for the Windows operating system.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, SupportContactDescription
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty SupportContactDescription
"SupportContactDescription = $value"
SystemFamily
The family to which a particular computer belongs. A family refers to a set of computers that are similar but not identical from a hardware or software point of view.
This value comes from the Family member of the System Information structure in the SMBIOS information.
This property is not supported before Windows 10 and Windows Server 2016.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, SystemFamily
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty SystemFamily
"SystemFamily = $value"
SystemSKUNumber
Identifies a particular computer configuration for sale. It is sometimes also called a product ID or purchase order number.
This value comes from the SKU Number member of the System Information structure in the SMBIOS information.
This property is not supported before Windows 10 and Windows Server 2016.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, SystemSKUNumber
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty SystemSKUNumber
"SystemSKUNumber = $value"
SystemStartupDelay
SystemStartupDelay is no longer available for use because Boot.ini is not used to configure system startup. Instead, use the BCD classes supplied by the Boot Configuration Data (BCD) WMI provider or the Bcdedit command.
SystemStartupOptions
SystemStartupOptions is no longer available for use because Boot.ini is not used to configure system startup. Instead, use the BCD classes supplied by the Boot Configuration Data (BCD) WMI provider or the Bcdedit command.
SystemStartupSetting
SystemStartupSetting is no longer available for use because Boot.ini is not used to configure system startup. Instead, use the BCD classes supplied by the Boot Configuration Data (BCD) WMI provider or the Bcdedit command.
SystemType
System running on the Windows-based computer. This property must have a value.
The following list identifies some of the possible values for this property.
X86-based PC (“X86-based PC”)
MIPS-based PC (“MIPS-based PC”)
Alpha-based PC (“Alpha-based PC”)
Power PC (“Power PC”)
SH-x PC (“SH-x PC”)
StrongARM PC (“StrongARM PC”)
64-bit Intel PC (“64-bit Intel PC”)
x64-based PC (“x64-based PC”)
Unknown (“Unknown”)
X86-Nec98 PC (“X86-Nec98 PC”)
Available values:
'64-bit Intel PC'', ''Alpha-based PC'', ''MIPS-based PC'', ''Power PC'', ''SH-x PC'', ''StrongARM PC'', ''x64-based PC'', ''X86-based PC'', ''X86-Nec98 PC'', ''Unknown''
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, SystemType
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty SystemType
"SystemType = $value"
ThermalState
Thermal state of the system when last booted.
This value comes from the Thermal State member of the System Enclosure or Chassis structure in the SMBIOS information.
ThermalState returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName ThermalState -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumThermalState
{
Other = 1
Unknown = 2
Safe = 3
Warning = 4
Critical = 5
Non_recoverable = 6
}
[EnumThermalState]($this.PSBase.CimInstanceProperties['ThermalState'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ThermalState
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$ThermalState = @{
Name = 'ThermalStateText'
Expression = {
$value = $_.ThermalState
switch([int]$value)
{
1 {'Other'}
2 {'Unknown'}
3 {'Safe'}
4 {'Warning'}
5 {'Critical'}
6 {'Non-recoverable'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ThermalState, $ThermalState
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$ThermalState_map = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Safe'
4 = 'Warning'
5 = 'Critical'
6 = 'Non-recoverable'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumThermalState
{
Other = 1
Unknown = 2
Safe = 3
Warning = 4
Critical = 5
Non_recoverable = 6
}
TotalPhysicalMemory
Total size of physical memory. Be aware that, under some circumstances, this property may not return an accurate value for the physical memory. For example, it is not accurate if the BIOS is using some of the physical memory. For an accurate value, use the Capacity property in Win32_PhysicalMemory instead.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, TotalPhysicalMemory
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty TotalPhysicalMemory
"TotalPhysicalMemory = ${value} bytes"
'TotalPhysicalMemory = {0:n1} GB' -f ($value/1GB)
You can update the PowerShell type database to automatically convert the raw property value. This example illustrates overwriting ToString() method to provide formatted output while leaving the original property value untouched:
# outputting raw value:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty TotalPhysicalMemory
# updating type database (needs to be done only once per PowerShell session)
# this command instructs PowerShell to overwrite the method ToString() and automatically divide the raw value and transform it in a different unit:
Update-TypeData -MemberName TotalPhysicalMemory -TypeName 'Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem' -MemberType ScriptProperty -Value { ($this.PSBase.CimInstanceProperties['TotalPhysicalMemory'].Value) | Add-Member -MemberType ScriptMethod -Name ToString -Force -Value { "{0:n1} GB" -f ($this/1GB) } -PassThru } -Force
# compare the results of the identical command.
# raw values are now automatically transformed into a more meaningful unit:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty TotalPhysicalMemory
UserName
Name of a user that is logged on currently. This property must have a value. In a terminal services session, UserName returns the name of the user that is logged on to the console not the user logged on during the terminal service session.
Example: jeffsmith
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, UserName
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty UserName
"UserName = $value"
WakeUpType
Event that causes the system to power up.
This value comes from the Wake-up Type member of the System Information structure in the SMBIOS information.
WakeUpType returns a numeric value. To translate it into a meaningful text, use any of the following approaches:
Use Update-Type
Update-Type
tells PowerShell how to interpret the property. This command needs to be executed only once per PowerShell session:
Update-TypeData -MemberName WakeUpType -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumWakeUpType
{
Reserved = 0
Other = 1
Unknown = 2
APM_Timer = 3
Modem_Ring = 4
LAN_Remote = 5
Power_Switch = 6
PCI_PME = 7
AC_Power_Restored = 8
}
[EnumWakeUpType]($this.PSBase.CimInstanceProperties['WakeUpType'].Value)
} -Force
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, WakeUpType
Use Select-Object
Select-Object
supports calculated properties. When you submit a hashtable, PowerShell dynamically calculates the result:
$WakeUpType = @{
Name = 'WakeUpTypeText'
Expression = {
$value = $_.WakeUpType
switch([int]$value)
{
0 {'Reserved'}
1 {'Other'}
2 {'Unknown'}
3 {'APM Timer'}
4 {'Modem Ring'}
5 {'LAN Remote'}
6 {'Power Switch'}
7 {'PCI PME'}
8 {'AC Power Restored'}
default {"$value"}
}
}
}
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, WakeUpType, $WakeUpType
Use a PowerShell Hashtable
You can use a PowerShell hashtable to decode numeric values. Use a hashtable like this one:
$WakeUpType_map = @{
0 = 'Reserved'
1 = 'Other'
2 = 'Unknown'
3 = 'APM Timer'
4 = 'Modem Ring'
5 = 'LAN Remote'
6 = 'Power Switch'
7 = 'PCI PME'
8 = 'AC Power Restored'
}
Use Enum structure
You can cast the raw property values to a new enum type to translate raw numeric values into friendly text. Use an enum like this one:
Enum EnumWakeUpType
{
Reserved = 0
Other = 1
Unknown = 2
APM_Timer = 3
Modem_Ring = 4
LAN_Remote = 5
Power_Switch = 6
PCI_PME = 7
AC_Power_Restored = 8
}
Workgroup
Name of the workgroup for this computer. If the value of the PartOfDomain property is $false
, then the name of the workgroup is returned.
# returning class instances:
Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, Workgroup
# reading property value:
$value = Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -ExpandProperty Workgroup
"Workgroup = $value"
CDXML Definition
You can turn this WMI class and its methods into PowerShell cmdlets by importing below CDXML file (Cmdlet Definition XML) as a module.
Create Win32_ComputerSystem.cdxml
$folder = "c:\wmi\Win32_ComputerSystem"
$cdxmlPath = Join-Path -Path $folder -ChildPath "Win32_ComputerSystem.cdxml"
# create folder if not present:
$exists = Test-Path -Path $folder
if (!$exists) { $null = New-Item -Path $folder -ItemType Directory }
# write file
$content = @'
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is licensed under 'Attribution 4.0 International' license (https://creativecommons.org/licenses/by/4.0/).
You can free of charge use this code in commercial and non-commercial code, and you can freely modify and adjust the code
as long as you give appropriate credit to the original author Dr. Tobias Weltner.
This material was published and is maintained here:
https://powershell.one/wmi/root/cimv2/win32_computersystem#cdxml-definition
-->
<PowerShellMetadata xmlns="http://schemas.microsoft.com/cmdlets-over-objects/2009/11">
<!--referencing the WMI class this cdxml uses-->
<Class ClassName="Root/CIMV2\Win32_ComputerSystem" ClassVersion="2.0">
<Version>1.0</Version>
<!--default noun used by Get-cmdlets and when no other noun is specified. By convention, we use the prefix "WMI" and the base name of the WMI class involved. This way, you can easily identify the underlying WMI class.-->
<DefaultNoun>WmiComputerSystem</DefaultNoun>
<!--define the cmdlets that work with class instances.-->
<InstanceCmdlets>
<!--query parameters to select instances. This is typically empty for classes that provide only one instance-->
<GetCmdletParameters />
<!--defining additional cmdlets that modifies instance properties-->
<!--Set-ComputerSystem: modifying instance properties-->
<Cmdlet>
<!--defining the ConfirmImpact which indicates how severe the changes are that this cmdlet performs-->
<CmdletMetadata Verb="Set" ConfirmImpact="Low" />
<!--using internal method to modify instance:-->
<Method MethodName="cim:ModifyInstance">
<!--defining the parameters of this cmdlet:-->
<Parameters>
<Parameter ParameterName="AutomaticManagedPagefile">
<!--the underlying parameter type is boolean which corresponds to the PowerShell .NET type [bool]-->
<Type PSType="bool" />
<CmdletParameterMetadata IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<Parameter ParameterName="AutomaticResetBootOption">
<!--the underlying parameter type is boolean which corresponds to the PowerShell .NET type [bool]-->
<Type PSType="bool" />
<CmdletParameterMetadata IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<Parameter ParameterName="CurrentTimeZone">
<!--the underlying parameter type is sint16 which corresponds to the PowerShell .NET type [Int16]-->
<Type PSType="Int16" />
<CmdletParameterMetadata IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<Parameter ParameterName="EnableDaylightSavingsTime">
<!--the underlying parameter type is boolean which corresponds to the PowerShell .NET type [bool]-->
<Type PSType="bool" />
<CmdletParameterMetadata IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<Parameter ParameterName="Roles">
<!--the underlying parameter type is string array which corresponds to the PowerShell .NET type [system.string[]]-->
<Type PSType="system.string[]" />
<CmdletParameterMetadata IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<Parameter ParameterName="SystemStartupDelay">
<!--the underlying parameter type is uint16 which corresponds to the PowerShell .NET type [system.uint16]-->
<Type PSType="system.uint16" />
<CmdletParameterMetadata IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<Parameter ParameterName="SystemStartupOptions">
<!--the underlying parameter type is string array which corresponds to the PowerShell .NET type [system.string[]]-->
<Type PSType="system.string[]" />
<CmdletParameterMetadata IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<Parameter ParameterName="SystemStartupSetting">
<!--the underlying parameter type is uint8 which corresponds to the PowerShell .NET type [byte]-->
<Type PSType="byte" />
<CmdletParameterMetadata IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<Parameter ParameterName="Workgroup">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
</Parameters>
</Method>
</Cmdlet>
<!--Add-ComputerSystemToDomainOrWorkgroup: invoking method JoinDomainOrWorkgroup():-->
<Cmdlet>
<!--defining the ConfirmImpact which indicates how severe the changes are that this cmdlet performs-->
<CmdletMetadata Verb="Add" Noun="WmiComputerSystemToDomainOrWorkgroup" ConfirmImpact="High" />
<!--defining the WMI instance method used by this cmdlet:-->
<Method MethodName="JoinDomainOrWorkgroup">
<ReturnValue>
<Type PSType="system.uint32" />
<CmdletOutputMetadata>
<ErrorCode />
</CmdletOutputMetadata>
</ReturnValue>
<!--defining the parameters of this cmdlet:-->
<Parameters>
<!--native parameter name is 'AccountOU'-->
<Parameter ParameterName="AccountOU">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata Position="0" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<!--native parameter name is 'FJoinOptions'-->
<Parameter ParameterName="FJoinOptions">
<!--the underlying parameter type is uint32 which really is the enumeration [Win32_ComputerSystem.FJoinOptions] that is defined below in the Enums node:-->
<Type PSType="Win32_ComputerSystem.FJoinOptions" />
<CmdletParameterMetadata Position="1" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<!--native parameter name is 'Name'-->
<Parameter ParameterName="Name">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata Position="2" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<!--native parameter name is 'Password'-->
<Parameter ParameterName="Password">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata Position="3" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<!--native parameter name is 'UserName'-->
<Parameter ParameterName="UserName">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata Position="4" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
</Parameters>
</Method>
</Cmdlet>
<!--Rename-ComputerSystem: invoking method Rename():-->
<Cmdlet>
<!--defining the ConfirmImpact which indicates how severe the changes are that this cmdlet performs-->
<CmdletMetadata Verb="Rename" Noun="WmiComputerSystem" ConfirmImpact="High" />
<!--defining the WMI instance method used by this cmdlet:-->
<Method MethodName="Rename">
<ReturnValue>
<Type PSType="system.uint32" />
<CmdletOutputMetadata>
<ErrorCode />
</CmdletOutputMetadata>
</ReturnValue>
<!--defining the parameters of this cmdlet:-->
<Parameters>
<!--native parameter name is 'Name'-->
<Parameter ParameterName="Name">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata Position="0" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<!--native parameter name is 'Password'-->
<Parameter ParameterName="Password">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata Position="1" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<!--native parameter name is 'UserName'-->
<Parameter ParameterName="UserName">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata Position="2" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
</Parameters>
</Method>
</Cmdlet>
<!--Remove-ComputerSystemToDomainOrWorkgroup: invoking method UnjoinDomainOrWorkgroup():-->
<Cmdlet>
<!--defining the ConfirmImpact which indicates how severe the changes are that this cmdlet performs-->
<CmdletMetadata Verb="Remove" Noun="WmiComputerSystemToDomainOrWorkgroup" ConfirmImpact="High" />
<!--defining the WMI instance method used by this cmdlet:-->
<Method MethodName="UnjoinDomainOrWorkgroup">
<ReturnValue>
<Type PSType="system.uint32" />
<CmdletOutputMetadata>
<ErrorCode />
</CmdletOutputMetadata>
</ReturnValue>
<!--defining the parameters of this cmdlet:-->
<Parameters>
<!--native parameter name is 'FUnjoinOptions'-->
<Parameter ParameterName="FUnjoinOptions">
<!--the underlying parameter type is uint32 which really is the enumeration [Win32_ComputerSystem.FUnjoinOptions] that is defined below in the Enums node:-->
<Type PSType="Win32_ComputerSystem.FUnjoinOptions" />
<CmdletParameterMetadata Position="0" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<!--native parameter name is 'Password'-->
<Parameter ParameterName="Password">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata Position="1" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
<!--native parameter name is 'UserName'-->
<Parameter ParameterName="UserName">
<!--the underlying parameter type is string which corresponds to the PowerShell .NET type [system.string]-->
<Type PSType="system.string" />
<CmdletParameterMetadata Position="2" IsMandatory="false">
<ValidateNotNull />
<ValidateNotNullOrEmpty />
</CmdletParameterMetadata>
</Parameter>
</Parameters>
</Method>
</Cmdlet>
</InstanceCmdlets>
</Class>
<!--defining enumerations-->
<Enums>
<Enum EnumName="Win32_ComputerSystem.AdminPasswordStatus" UnderlyingType="system.uint16">
<Value Name="Disabled" Value="0" />
<Value Name="Enabled" Value="1" />
<Value Name="NotImplemented" Value="2" />
<Value Name="Unknown" Value="3" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.BootOptionOnLimit" UnderlyingType="system.uint16">
<Value Name="Reserved" Value="0" />
<Value Name="OperatingSystem" Value="1" />
<Value Name="SystemUtilities" Value="2" />
<Value Name="DoNotReboot" Value="3" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.BootOptionOnWatchDog" UnderlyingType="system.uint16">
<Value Name="Reserved" Value="0" />
<Value Name="OperatingSystem" Value="1" />
<Value Name="SystemUtilities" Value="2" />
<Value Name="DoNotReboot" Value="3" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.ChassisBootupState" UnderlyingType="system.uint16">
<Value Name="Other" Value="1" />
<Value Name="Unknown" Value="2" />
<Value Name="Safe" Value="3" />
<Value Name="Warning" Value="4" />
<Value Name="Critical" Value="5" />
<Value Name="Nonrecoverable" Value="6" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.DomainRole" UnderlyingType="system.uint16">
<Value Name="StandaloneWorkstation" Value="0" />
<Value Name="MemberWorkstation" Value="1" />
<Value Name="StandaloneServer" Value="2" />
<Value Name="MemberServer" Value="3" />
<Value Name="BackupDomainController" Value="4" />
<Value Name="PrimaryDomainController" Value="5" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.FJoinOptions" UnderlyingType="system.uint32" BitwiseFlags="true">
<Value Name="JoinDomain" Value="1" />
<Value Name="AccountCreate" Value="2" />
<Value Name="Reserved1" Value="4" />
<Value Name="Reserved2" Value="8" />
<Value Name="Upgrade" Value="16" />
<Value Name="JoinIfJoined" Value="32" />
<Value Name="JoinUnsecure" Value="64" />
<Value Name="MachinePwdPassed" Value="128" />
<Value Name="DeferSpnSet" Value="256" />
<Value Name="JoinDCAccount" Value="512" />
<Value Name="Reserved3" Value="1024" />
<Value Name="Reserved4" Value="2048" />
<Value Name="AmbiguousDC" Value="4096" />
<Value Name="NoNetlogonCache" Value="8192" />
<Value Name="DontControlServices" Value="16384" />
<Value Name="SetMachineName" Value="32768" />
<Value Name="ForceSPNSet" Value="65536" />
<Value Name="NoAccountReuse" Value="131072" />
<Value Name="IgnoreUnsupportedFlag" Value="268435456" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.FrontPanelResetStatus" UnderlyingType="system.uint16">
<Value Name="Disabled" Value="0" />
<Value Name="Enabled" Value="1" />
<Value Name="NotImplemented" Value="2" />
<Value Name="Unknown" Value="3" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.FUnjoinOptions" UnderlyingType="system.uint32" BitwiseFlags="true">
<Value Name="AccountDelete" Value="4" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.KeyboardPasswordStatus" UnderlyingType="system.uint16">
<Value Name="Disabled" Value="0" />
<Value Name="Enabled" Value="1" />
<Value Name="NotImplemented" Value="2" />
<Value Name="Unknown" Value="3" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.PCSystemType" UnderlyingType="system.uint16">
<Value Name="Unspecified" Value="0" />
<Value Name="Desktop" Value="1" />
<Value Name="Mobile" Value="2" />
<Value Name="Workstation" Value="3" />
<Value Name="EnterpriseServer" Value="4" />
<Value Name="SOHOServer" Value="5" />
<Value Name="AppliancePC" Value="6" />
<Value Name="PerformanceServer" Value="7" />
<Value Name="Maximum" Value="8" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.PCSystemTypeEx" UnderlyingType="system.uint16">
<Value Name="Unspecified" Value="0" />
<Value Name="Desktop" Value="1" />
<Value Name="Mobile" Value="2" />
<Value Name="Workstation" Value="3" />
<Value Name="EnterpriseServer" Value="4" />
<Value Name="SOHOServer" Value="5" />
<Value Name="AppliancePC" Value="6" />
<Value Name="PerformanceServer" Value="7" />
<Value Name="Slate" Value="8" />
<Value Name="Maximum" Value="9" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.PowerOnPasswordStatus" UnderlyingType="system.uint16">
<Value Name="Disabled" Value="0" />
<Value Name="Enabled" Value="1" />
<Value Name="Notimplemented" Value="2" />
<Value Name="Unknown" Value="3" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.PowerState" UnderlyingType="system.uint16">
<Value Name="Unknown" Value="0" />
<Value Name="FullPower" Value="1" />
<Value Name="PowerSaveLowPowerMode" Value="2" />
<Value Name="PowerSaveStandby" Value="3" />
<Value Name="PowerSaveUnknown" Value="4" />
<Value Name="PowerCycle" Value="5" />
<Value Name="PowerOff" Value="6" />
<Value Name="PowerSaveWarning" Value="7" />
<Value Name="PowerSaveHibernate" Value="8" />
<Value Name="PowerSaveSoftOff" Value="9" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.PowerSupplyState" UnderlyingType="system.uint16">
<Value Name="Other" Value="1" />
<Value Name="Unknown" Value="2" />
<Value Name="Safe" Value="3" />
<Value Name="Warning" Value="4" />
<Value Name="Critical" Value="5" />
<Value Name="Nonrecoverable" Value="6" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.ResetCapability" UnderlyingType="system.uint16">
<Value Name="Other" Value="1" />
<Value Name="Unknown" Value="2" />
<Value Name="Disabled" Value="3" />
<Value Name="Enabled" Value="4" />
<Value Name="NotImplemented" Value="5" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.ThermalState" UnderlyingType="system.uint16">
<Value Name="Other" Value="1" />
<Value Name="Unknown" Value="2" />
<Value Name="Safe" Value="3" />
<Value Name="Warning" Value="4" />
<Value Name="Critical" Value="5" />
<Value Name="Nonrecoverable" Value="6" />
</Enum>
<Enum EnumName="Win32_ComputerSystem.WakeUpType" UnderlyingType="system.uint16">
<Value Name="Reserved" Value="0" />
<Value Name="Other" Value="1" />
<Value Name="Unknown" Value="2" />
<Value Name="APMTimer" Value="3" />
<Value Name="ModemRing" Value="4" />
<Value Name="LANRemote" Value="5" />
<Value Name="PowerSwitch" Value="6" />
<Value Name="PCIPME" Value="7" />
<Value Name="ACPowerRestored" Value="8" />
</Enum>
</Enums>
</PowerShellMetadata>
'@ | Set-Content -LiteralPath $cdxmlPath -Encoding UTF8
# import module
Import-Module -Name $cdxmlPath -Force -Verbose
# list new cmdlets
Get-Command -Module "Win32_ComputerSystem"
Type Extensions for PowerShell
You can automatically improve properties of class instances by using a types.ps1xml file.
Create Win32_ComputerSystem.Types.ps1xml
$folder = "c:\wmi\Win32_ComputerSystem"
$typesPath = Join-Path -Path $folder -ChildPath "Win32_ComputerSystem.Types.ps1xml"
# create folder if not present:
$exists = Test-Path -Path $folder
if (!$exists) { $null = New-Item -Path $folder -ItemType Directory }
# write file
$content = @'
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is licensed under 'Attribution 4.0 International' license (https://creativecommons.org/licenses/by/4.0/).
You can free of charge use this code in commercial and non-commercial code, and you can freely modify and adjust the code
as long as you give appropriate credit to the original author Dr. Tobias Weltner.
This material was published and is maintained here:
https://powershell.one/wmi/root/cimv2/win32_computersystem#typesps1xml-file
-->
<Types>
<Type>
<!--@
Applicable type. This type is produced by Get-CimInstance.
To extend instances produced by Get-WmiObject, change the type name to:
System.Management.ManagementObject#root/cimv2\Win32_ComputerSystem
@-->
<Name>Microsoft.Management.Infrastructure.CimInstance#Root/CIMV2/Win32_ComputerSystem</Name>
<Members>
<ScriptProperty>
<Name>AdminPasswordStatus</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.AdminPasswordStatus]($this.PSBase.CimInstanceProperties['AdminPasswordStatus'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>BootOptionOnLimit</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.BootOptionOnLimit]($this.PSBase.CimInstanceProperties['BootOptionOnLimit'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>BootOptionOnWatchDog</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.BootOptionOnWatchDog]($this.PSBase.CimInstanceProperties['BootOptionOnWatchDog'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>ChassisBootupState</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.ChassisBootupState]($this.PSBase.CimInstanceProperties['ChassisBootupState'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>DomainRole</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.DomainRole]($this.PSBase.CimInstanceProperties['DomainRole'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>FrontPanelResetStatus</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.FrontPanelResetStatus]($this.PSBase.CimInstanceProperties['FrontPanelResetStatus'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>KeyboardPasswordStatus</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.KeyboardPasswordStatus]($this.PSBase.CimInstanceProperties['KeyboardPasswordStatus'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>PCSystemType</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.PCSystemType]($this.PSBase.CimInstanceProperties['PCSystemType'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>PCSystemTypeEx</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.PCSystemTypeEx]($this.PSBase.CimInstanceProperties['PCSystemTypeEx'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>PowerOnPasswordStatus</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.PowerOnPasswordStatus]($this.PSBase.CimInstanceProperties['PowerOnPasswordStatus'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>PowerState</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.PowerState]($this.PSBase.CimInstanceProperties['PowerState'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>PowerSupplyState</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.PowerSupplyState]($this.PSBase.CimInstanceProperties['PowerSupplyState'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>ResetCapability</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.ResetCapability]($this.PSBase.CimInstanceProperties['ResetCapability'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>ThermalState</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.ThermalState]($this.PSBase.CimInstanceProperties['ThermalState'].Value)</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>TotalPhysicalMemory</Name>
<!--overwriting ToString() method to provide formatted output while leaving the original property value untouched:-->
<GetScriptBlock>($this.PSBase.CimInstanceProperties['TotalPhysicalMemory'].Value) | Add-Member -MemberType ScriptMethod -Name ToString -Force -Value { "{0:n1} GB" -f ($this/1GB) } -PassThru</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>WakeUpType</Name>
<!--casting raw content to a enum. This translates numeric values to friendly text while leaving the original property value untouched:-->
<GetScriptBlock>[Microsoft.PowerShell.Cmdletization.GeneratedTypes.Win32_ComputerSystem.WakeUpType]($this.PSBase.CimInstanceProperties['WakeUpType'].Value)</GetScriptBlock>
</ScriptProperty>
</Members>
</Type>
</Types>
'@ | Set-Content -LiteralPath $typesPath -Encoding UTF8
# import type definition
Update-TypeData -PrependPath $typesPath
Note: Win32_ComputerSystem.Types.ps1xml is using enumerations defined in ClassName.cdxml which are available only when you imported the .cdxml file via
Import-Module
.
Or, you can manually update the PowerShell type database using Update-TypeData
.
View Update-TypeData
commands for Win32_ComputerSystem properties
Update-TypeData -MemberName AdminPasswordStatus -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumAdminPasswordStatus
{
Disabled = 0
Enabled = 1
NotImplemented = 2
Unknown = 3
}
[EnumAdminPasswordStatus]($this.PSBase.CimInstanceProperties['AdminPasswordStatus'].Value)
} -Force
Update-TypeData -MemberName BootOptionOnLimit -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumBootOptionOnLimit
{
Reserved = 0
OperatingSystem = 1
SystemUtilities = 2
DoNotReboot = 3
}
[EnumBootOptionOnLimit]($this.PSBase.CimInstanceProperties['BootOptionOnLimit'].Value)
} -Force
Update-TypeData -MemberName BootOptionOnWatchDog -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumBootOptionOnWatchDog
{
Reserved = 0
OperatingSystem = 1
SystemUtilities = 2
DoNotReboot = 3
}
[EnumBootOptionOnWatchDog]($this.PSBase.CimInstanceProperties['BootOptionOnWatchDog'].Value)
} -Force
Update-TypeData -MemberName ChassisBootupState -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumChassisBootupState
{
Other = 1
Unknown = 2
Safe = 3
Warning = 4
Critical = 5
Non_recoverable = 6
}
[EnumChassisBootupState]($this.PSBase.CimInstanceProperties['ChassisBootupState'].Value)
} -Force
Update-TypeData -MemberName DomainRole -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumDomainRole
{
Standalone_Workstation_ = 0
Member_Workstation = 1
Standalone_Server = 2
Member_Server_ = 3
Backup_Domain_Controller_ = 4
Primary_Domain_Controller = 5
}
[EnumDomainRole]($this.PSBase.CimInstanceProperties['DomainRole'].Value)
} -Force
Update-TypeData -MemberName FrontPanelResetStatus -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumFrontPanelResetStatus
{
Disabled = 0
Enabled = 1
Not_Implemented = 2
Unknown = 3
}
[EnumFrontPanelResetStatus]($this.PSBase.CimInstanceProperties['FrontPanelResetStatus'].Value)
} -Force
Update-TypeData -MemberName KeyboardPasswordStatus -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumKeyboardPasswordStatus
{
Disabled = 0
Enabled = 1
Not_Implemented = 2
Unknown = 3
}
[EnumKeyboardPasswordStatus]($this.PSBase.CimInstanceProperties['KeyboardPasswordStatus'].Value)
} -Force
Update-TypeData -MemberName PCSystemType -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPCSystemType
{
Unspecified = 0
Desktop = 1
Mobile = 2
Workstation = 3
Enterprise_Server = 4
SOHO_Server = 5
Appliance_PC = 6
Performance_Server = 7
Maximum = 8
}
[EnumPCSystemType]($this.PSBase.CimInstanceProperties['PCSystemType'].Value)
} -Force
Update-TypeData -MemberName PCSystemTypeEx -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPCSystemTypeEx
{
Unspecified = 0
Desktop = 1
Mobile = 2
Workstation = 3
Enterprise_Server = 4
SOHO_Server = 5
Appliance_PC = 6
Performance_Server = 7
Slate = 8
Maximum = 9
}
[EnumPCSystemTypeEx]($this.PSBase.CimInstanceProperties['PCSystemTypeEx'].Value)
} -Force
Update-TypeData -MemberName PowerOnPasswordStatus -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPowerOnPasswordStatus
{
Disabled = 0
Enabled = 1
Not_implemented = 2
Unknown = 3
}
[EnumPowerOnPasswordStatus]($this.PSBase.CimInstanceProperties['PowerOnPasswordStatus'].Value)
} -Force
Update-TypeData -MemberName PowerState -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPowerState
{
Unknown = 0
Full_Power = 1
Power_Save_Low_Power_Mode = 2
Power_Save_Standby = 3
Power_Save_Unknown = 4
Power_Cycle = 5
Power_Off = 6
Power_Save_Warning = 7
Power_Save_Hibernate = 8
Power_Save_Soft_Off = 9
}
[EnumPowerState]($this.PSBase.CimInstanceProperties['PowerState'].Value)
} -Force
Update-TypeData -MemberName PowerSupplyState -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumPowerSupplyState
{
Other = 1
Unknown = 2
Safe = 3
Warning = 4
Critical = 5
Non_recoverable = 6
}
[EnumPowerSupplyState]($this.PSBase.CimInstanceProperties['PowerSupplyState'].Value)
} -Force
Update-TypeData -MemberName ResetCapability -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumResetCapability
{
Other = 1
Unknown = 2
Disabled = 3
Enabled = 4
Not_Implemented = 5
}
[EnumResetCapability]($this.PSBase.CimInstanceProperties['ResetCapability'].Value)
} -Force
Update-TypeData -MemberName ThermalState -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumThermalState
{
Other = 1
Unknown = 2
Safe = 3
Warning = 4
Critical = 5
Non_recoverable = 6
}
[EnumThermalState]($this.PSBase.CimInstanceProperties['ThermalState'].Value)
} -Force
Update-TypeData -MemberName TotalPhysicalMemory -TypeName 'Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem' -MemberType ScriptProperty -Value { ($this.PSBase.CimInstanceProperties['TotalPhysicalMemory'].Value) | Add-Member -MemberType ScriptMethod -Name ToString -Force -Value { "{0:n1} GB" -f ($this/1GB) } -PassThru } -Force
Update-TypeData -MemberName WakeUpType -TypeName "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/win32_computersystem" -MemberType ScriptProperty -Value {
Enum EnumWakeUpType
{
Reserved = 0
Other = 1
Unknown = 2
APM_Timer = 3
Modem_Ring = 4
LAN_Remote = 5
Power_Switch = 6
PCI_PME = 7
AC_Power_Restored = 8
}
[EnumWakeUpType]($this.PSBase.CimInstanceProperties['WakeUpType'].Value)
} -Force
Note: Win32_ComputerSystem.Types.ps1xml is using enumerations defined in ClassName.cdxml which are available only when you imported the .cdxml file via
Import-Module
.
Requirements
To use Win32_ComputerSystem, 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_ComputerSystem was introduced on clients with Windows Vista and on servers with Windows Server 2008.
Namespace
Win32_ComputerSystem 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_ComputerSystem 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