CIM_OperatingSystem

CIM Operating System
root/cimv2abstract

The CIM_OperatingSystem class represents a computer operating system, which is made up of software and firmware that make a computer system's hardware usable.

On this page

Main example

List instances

# Abstract class: Get-CimInstance returns the instances of its subclasses
Get-CimInstance -ClassName CIM_OperatingSystem |
    Select-Object -Property CSName, Name, Caption, Description, Status, Version, InstallDate

Abstract class: it has no instances of its own. Get-CimInstance returns the instances of its subclasses (Win32_OperatingSystem).

Examples

Query a remote computer (CIM session)

review before running
# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
    Get-CimInstance -CimSession $cimSession -ClassName CIM_OperatingSystem |
        Select-Object -Property @(
            'CSName'
            'Name'
            'Caption'
            'Description'
            'Status'
            'Version'
            'InstallDate'
        )
} finally {
    Remove-CimSession -CimSession $cimSession
}

WSMan (WinRM) is used by default. For a host without WinRM, create the session with -SessionOption (New-CimSessionOption -Protocol Dcom). Add -Credential to use another account.

Show the class structure

# Class structure: properties, types and flags (Key, ReadOnly…)
$cimClass = Get-CimClass -ClassName CIM_OperatingSystem
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

27 of 27 properties
NameTypeAccessDescription
Captionstringread

Short textual description of the object.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Caption for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, Caption |
    Select-Object -Property CSName, Caption
CreationClassName keystringread

Name of the class or subclass used in the creation of an instance. When used with other key properties of the class, this property allows all instances of the class and its subclasses to be uniquely identified.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of CreationClassName for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, CreationClassName |
    Select-Object -Property CSName, CreationClassName
CSCreationClassName keystringread

Scoping computer system's creation class name.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of CSCreationClassName for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, CSCreationClassName |
    Select-Object -Property CSName, CSCreationClassName
CSName keystringread

Scoping computer system's name.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of CSName for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName |
    Select-Object -Property CSName
CurrentTimeZonesint16read

Number of minutes the operating system is offset from Greenwich Mean Time (GMT). The number is positive, negative, or zero.

Unit: minutes

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of CurrentTimeZone for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, CurrentTimeZone |
    Select-Object -Property CSName, CurrentTimeZone
Descriptionstringread

Textual description of the object.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Description for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, Description |
    Select-Object -Property CSName, Description
Distributedbooleanread

If TRUE, the operating system is distributed across several computer system nodes, which should be grouped as a cluster.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Distributed for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, Distributed |
    Select-Object -Property CSName, Distributed
FreePhysicalMemoryuint64read

Number of kilobytes of physical memory currently unused and available.

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

Unit: kilobytes

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of FreePhysicalMemory for each instance
# FreePhysicalMemory is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, FreePhysicalMemory |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'FreePhysicalMemoryGB'; Expression = { [math]::Round($_.FreePhysicalMemory / 1MB, 2) } }
    )
FreeSpaceInPagingFilesuint64read

Number of kilobytes that can be mapped into the operating system's paging files without causing other pages to be swapped out. A value of 0 indicates that there are no paging files.

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

Unit: kilobytes

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of FreeSpaceInPagingFiles for each instance
# FreeSpaceInPagingFiles is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, FreeSpaceInPagingFiles |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'FreeSpaceInPagingFilesGB'; Expression = { [math]::Round($_.FreeSpaceInPagingFiles / 1MB, 2) } }
    )
FreeVirtualMemoryuint64read

Number of kilobytes of virtual memory currently unused and available. For example, this can be calculated by adding the amount of free RAM to the amount of free paging space (that is, adding the FreePhysicalMemory and FreeSpaceInPagingFiles properties).

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

Unit: kilobytes

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of FreeVirtualMemory for each instance
# FreeVirtualMemory is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, FreeVirtualMemory |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'FreeVirtualMemoryGB'; Expression = { [math]::Round($_.FreeVirtualMemory / 1MB, 2) } }
    )
InstallDatedatetimeread

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

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of InstallDate for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, InstallDate |
    Select-Object -Property CSName, InstallDate
LastBootUpTimedatetimeread

Time when the operating system was last booted.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of LastBootUpTime for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, LastBootUpTime |
    Select-Object -Property CSName, LastBootUpTime
LocalDateTimedatetimeread

Operating system's notion of the local date and time of day.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of LocalDateTime for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, LocalDateTime |
    Select-Object -Property CSName, LocalDateTime
MaxNumberOfProcessesuint32read

Maximum number of process contexts the operating system can support. If there is no fixed maximum, the value should be 0 (zero). On systems that have a fixed maximum, this object can help diagnose failures that occur when the maximum is reached. If unknown, enter -1.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of MaxNumberOfProcesses for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, MaxNumberOfProcesses |
    Select-Object -Property CSName, MaxNumberOfProcesses
MaxProcessMemorySizeuint64read

Maximum number of kilobytes of memory that can be allocated to a process. For operating systems with no virtual memory, this value is typically equal to the total amount of physical memory, minus memory used by the BIOS and the operating system. For some operating systems, this value can be infinity, in which case 0 should be entered. In other cases, this value can be a constant, for example, 2 GB or 4 GB.

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

Unit: kilobytes

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of MaxProcessMemorySize for each instance
# MaxProcessMemorySize is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, MaxProcessMemorySize |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'MaxProcessMemorySizeGB'; Expression = { [math]::Round($_.MaxProcessMemorySize / 1MB, 2) } }
    )
Namestringread

Key of an operating system instance within a computer system.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Name for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, Name |
    Select-Object -Property CSName, Name
NumberOfLicensedUsersuint32read

Number of user licenses for the operating system. If unlimited, enter 0, if unknown, enter -1.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of NumberOfLicensedUsers for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, NumberOfLicensedUsers |
    Select-Object -Property CSName, NumberOfLicensedUsers
NumberOfProcessesuint32read

Number of process contexts currently loaded or running on the operating system.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of NumberOfProcesses for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, NumberOfProcesses |
    Select-Object -Property CSName, NumberOfProcesses
NumberOfUsersuint32read

Number of user sessions for which the operating system is currently storing state information.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of NumberOfUsers for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, NumberOfUsers |
    Select-Object -Property CSName, NumberOfUsers
OSTypeuint16read

Type of operating system.

Values (63)
ValueLabelDescription
0Unknown
1Other
2MACOSMac OS
3ATTUNIXATT UNIX
4DGUX
5DECNT
6Digital Unix
7OpenVMSOpen VMS
8HPUXHP-UX
9AIX
10MVS
11OS400
12OS/2
13JavaVMMicrosoft Virtual Machine (VM) for Java
14MSDOS
15WIN3xWindows 3.x
16WIN95Windows 95
17WIN98Windows 98
18WINNTWindows NT
19WINCEWindows CE
20NCR3000NCR 3000
21NetWare
22OSF
23DC/OS
24Reliant UNIX
25SCO UnixWare
26SCO OpenServer
27Sequent
28IRIX
29Solaris
30SunOS
31U6000
32ASERIESA Series
33TandemNSKTandem NSK
34TandemNTTandem NT
35BS2000BS2000/OSD
36LINUX
37Lynx
38XENIX
39VM/ESA
40Interactive UNIX
41BSDUNIXBSD UNIX
42FreeBSD
43NetBSD
44GNU Hurd
45OS9Mac OS 9
46MACH Kernel
47Inferno
48QNX
49EPOC
50IxWorks
51VxWorks
52MiNT
53BeOS
54HP MPE
55NextStep
56PalmPilotPalm OS
57Rhapsody
58Windows 2000
59Dedicated
60OS/390
61VSE
62TPF
Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of OSType for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, OSType |
    Select-Object -Property CSName, OSType
OtherTypeDescriptionstringread

Describes the manufacturer and operating system type when the OSType property is set to 1 ("Other"). The format of the string inserted in OtherTypeDescription should be similar to the Values strings defined for OSType. This property should be set to null when OSType is a value other than 1 (one).

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of OtherTypeDescription for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, OtherTypeDescription |
    Select-Object -Property CSName, OtherTypeDescription
SizeStoredInPagingFilesuint64read

Number of kilobytes that can be stored in the operating system's paging files. This number does not represent the actual physical size of the paging file on disk. A value of 0 (zero)indicates that there are no paging files.

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

Unit: kilobytes

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of SizeStoredInPagingFiles for each instance
# SizeStoredInPagingFiles is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, SizeStoredInPagingFiles |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'SizeStoredInPagingFilesGB'; Expression = { [math]::Round($_.SizeStoredInPagingFiles / 1MB, 2) } }
    )
Statusstringread

Current status of the object.

Values include the following:

Values (12)
ValueLabelDescription
OKOK
ErrorError
DegradedDegraded
UnknownUnknown
Pred FailPred Fail
StartingStarting
StoppingStopping
ServiceService
StressedStressed
NonRecoverNonRecover
No ContactNo Contact
Lost CommLost Comm
Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Status for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, Status |
    Select-Object -Property CSName, Status
TotalSwapSpaceSizeuint64read

Total swap space, in kilobytes. This value can be null (unspecified) if swap space is not distinguished from page files. However, some operating systems distinguish these concepts. For example, entire processes can be "swapped out" in UNIX when the free page list falls and remains below a specified amount.

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

Unit: kilobytes

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of TotalSwapSpaceSize for each instance
# TotalSwapSpaceSize is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, TotalSwapSpaceSize |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'TotalSwapSpaceSizeGB'; Expression = { [math]::Round($_.TotalSwapSpaceSize / 1MB, 2) } }
    )
TotalVirtualMemorySizeuint64read

Number of kilobytes of virtual memory. For example, calculate this by adding the amount of total RAM to the amount of paging space (that is, add the amount of memory in or aggregated by the computer system to the SizeStoredInPagingFiles property.

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

Unit: kilobytes

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of TotalVirtualMemorySize for each instance
# TotalVirtualMemorySize is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, TotalVirtualMemorySize |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'TotalVirtualMemorySizeGB'; Expression = { [math]::Round($_.TotalVirtualMemorySize / 1MB, 2) } }
    )
TotalVisibleMemorySizeuint64read

Total amount of physical memory, in kilobytes, available to the operating system. This value does not necessarily indicate the true amount of physical memory, but what is reported to the operating system as available to it.

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

Unit: kilobytes

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of TotalVisibleMemorySize for each instance
# TotalVisibleMemorySize is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, TotalVisibleMemorySize |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'TotalVisibleMemorySizeGB'; Expression = { [math]::Round($_.TotalVisibleMemorySize / 1MB, 2) } }
    )
Versionstringread

Version of the operation.

The version of the operation should be in one of the following forms:

  • <major>.<minor>.<revision>
  • <major>.<minor><letter><revision>
Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Version for each instance
Get-CimInstance -ClassName CIM_OperatingSystem -Property CSName, Version |
    Select-Object -Property CSName, Version

Remarks

The CIM_OperatingSystem class is derived from CIM_LogicalElement.

WMI does not implement this class. For WMI classes that are derived from CIM_OperatingSystem, see Win32 Classes.

This documentation is derived from the CIM class descriptions published by the DMTF. Microsoft may have made changes to correct minor errors, conform to Microsoft SDK documentation standards, or provide more information.

Inheritance

Superclass chain

  1. CIM_ManagedSystemElement
  2. CIM_LogicalElement
  3. CIM_OperatingSystem

Known subclasses

Requirements

Namespace
root/cimv2
Minimum client
Windows Vista
Minimum server
Windows Server 2008
MOF file
CIMWin32.mof
DLL
CIMWin32.dll
Class qualifiers

Abstract UUID("{8502C565-5FBB-11D2-AAC1-006008C78BC7}") AMENDMENT

Microsoft source

Source: Microsoft Learn

Descriptions, properties and methods come from the Microsoft documentation (MicrosoftDocs/win32 repository), published under the CC BY 4.0 licence. Formatting and translations are specific to this site; the PowerShell examples are written for it.