Win32_OperatingSystem

Win32 Operating System
root/cimv2dynamicsingleton

Represents a Windows-based operating system installed on a computer.

On this page

Main example

List instances

# All instances of Win32_OperatingSystem, with the main properties
Get-CimInstance -ClassName Win32_OperatingSystem |
    Select-Object -Property @(
        'Caption'
        'Version'
        'BuildNumber'
        'OSArchitecture'
        'LastBootUpTime'
        @{ Name = 'TotalVisibleMemorySizeGB'; Expression = { [math]::Round($_.TotalVisibleMemorySize / 1MB, 2) } }
        @{ Name = 'FreePhysicalMemoryGB'; Expression = { [math]::Round($_.FreePhysicalMemory / 1MB, 2) } }
    )

Singleton class: only one instance exists.

Examples

Decode numeric values

# Lookup table for DataExecutionPrevention_SupportPolicy (values documented by Microsoft)
$dataExecutionPrevention_SupportPolicyName = @{
    0 = 'Always Off'
    1 = 'Always On'
    2 = 'Opt In'
    3 = 'Opt Out'
}
# Lookup table for EncryptionLevel (values documented by Microsoft)
$encryptionLevelName = @{
    0 = '40-bit'
    1 = '128-bit'
    2 = 'n-bit'
}

Get-CimInstance -ClassName Win32_OperatingSystem |
    Select-Object -Property @(
        'Caption'
        'Version'
        'BuildNumber'
        'OSArchitecture'
        'LastBootUpTime'
        @{ Name = 'TotalVisibleMemorySizeGB'; Expression = { [math]::Round($_.TotalVisibleMemorySize / 1MB, 2) } }
        @{ Name = 'FreePhysicalMemoryGB'; Expression = { [math]::Round($_.FreePhysicalMemory / 1MB, 2) } }
    )

Query a remote computer (CIM session)

review before running
# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
    Get-CimInstance -CimSession $cimSession -ClassName Win32_OperatingSystem |
        Select-Object -Property @(
            'Caption'
            'Version'
            'BuildNumber'
            'OSArchitecture'
            'LastBootUpTime'
            @{ Name = 'TotalVisibleMemorySizeGB'; Expression = { [math]::Round($_.TotalVisibleMemorySize / 1MB, 2) } }
            @{ Name = 'FreePhysicalMemoryGB'; Expression = { [math]::Round($_.FreePhysicalMemory / 1MB, 2) } }
        )
} finally {
    Remove-CimSession -CimSession $cimSession
}

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

Show the class structure

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

# Methods of the class
$cimClass.CimClassMethods |
    Select-Object -Property Name, ReturnType

Properties

66 of 66 properties
NameTypeAccessDescription
BootDevicestringread

Name of the disk drive from which the Windows operating system starts.

Example: "\\Device\Harddisk0"

Code
# Value of BootDevice for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, BootDevice |
    Select-Object -Property CSName, BootDevice
BuildNumberstringread

Build number of an operating system. It can be used for more precise version information than product release version numbers.

Example: "1381"

Code
# Value of BuildNumber for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, BuildNumber |
    Select-Object -Property CSName, BuildNumber
BuildTypestringread

Type of build used for an operating system.

Examples: ""retail build"", ""checked build""

Code
# Value of BuildType for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, BuildType |
    Select-Object -Property CSName, BuildType
Captionstringread

Short description of the object—a one-line string. The string includes the operating system version. For example, "Microsoft Windows 7 Enterprise ". This property can be localized.

Windows Vista and Windows 7: This property may contain trailing characters. For example, the string "Microsoft Windows 7 Enterprise " (trailing space included) may be necessary to retrieve information using this property.

Code
# Value of Caption for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Caption |
    Select-Object -Property CSName, Caption
CodeSetstringread

Code page value an operating system uses. A code page contains a character table that an operating system uses to translate strings for different languages. The American National Standards Institute (ANSI) lists values that represent defined code pages. If an operating system does not use an ANSI code page, this member is set to 0 (zero). The CodeSet string can use a maximum of six characters to define the code page value.

Example: "1255"

Code
# Value of CodeSet for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, CodeSet |
    Select-Object -Property CSName, CodeSet
CountryCodestringread

Code for the country/region that an operating system uses. Values are based on international phone dialing prefixes—also referred to as IBM country/region codes. This property can use a maximum of six characters to define the country/region code value.

Example: "1" (United States)

Code
# Value of CountryCode for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, CountryCode |
    Select-Object -Property CSName, CountryCode
CreationClassName keystringread

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

Code
# Value of CreationClassName for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, CreationClassName |
    Select-Object -Property CSName, CreationClassName
CSCreationClassName keystringread

Creation class name of the scoping computer system.

Code
# Value of CSCreationClassName for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, CSCreationClassName |
    Select-Object -Property CSName, CSCreationClassName
CSDVersionstringread

NULL-terminated string that indicates the latest service pack installed on a computer. If no service pack is installed, the string is NULL.

Example: "Service Pack 3"

Code
# Value of CSDVersion for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, CSDVersion |
    Select-Object -Property CSName, CSDVersion
CSName keystringread

Name of the scoping computer system.

Code
# Value of CSName for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName |
    Select-Object -Property CSName
CurrentTimeZonesint16read

Number, in minutes, an operating system is offset from Greenwich mean time (GMT). The number is positive, negative, or zero.

Unit: minutes

Code
# Value of CurrentTimeZone for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, CurrentTimeZone |
    Select-Object -Property CSName, CurrentTimeZone
DataExecutionPrevention_32BitApplicationsbooleanread

When the data execution prevention hardware feature is available, this property indicates that the feature is set to work for 32-bit applications if True. On 64-bit computers, the data execution prevention feature is configured in the Boot Configuration Data (BCD) store and the properties in Win32_OperatingSystem are set accordingly.

Code
# Value of DataExecutionPrevention_32BitApplications for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, DataExecutionPrevention_32BitApplications |
    Select-Object -Property CSName, DataExecutionPrevention_32BitApplications
DataExecutionPrevention_Availablebooleanread

Data execution prevention is a hardware feature to prevent buffer overrun attacks by stopping the execution of code on data-type memory pages. If True, then this feature is available. On 64-bit computers, the data execution prevention feature is configured in the BCD store and the properties in Win32_OperatingSystem are set accordingly.

Code
# Value of DataExecutionPrevention_Available for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, DataExecutionPrevention_Available |
    Select-Object -Property CSName, DataExecutionPrevention_Available
DataExecutionPrevention_Driversbooleanread

When the data execution prevention hardware feature is available, this property indicates that the feature is set to work for drivers if True. On 64-bit computers, the data execution prevention feature is configured in the BCD store and the properties in Win32_OperatingSystem are set accordingly.

Code
# Value of DataExecutionPrevention_Drivers for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, DataExecutionPrevention_Drivers |
    Select-Object -Property CSName, DataExecutionPrevention_Drivers
DataExecutionPrevention_SupportPolicyuint8read

Indicates which Data Execution Prevention (DEP) setting is applied. The DEP setting specifies the extent to which DEP applies to 32-bit applications on the system. DEP is always applied to the Windows kernel.

Values (4)
ValueLabelDescription
0Always OffDEP is turned off for all 32-bit applications on the computer with no exceptions. This setting is not available for the user interface.
1Always OnDEP is enabled for all 32-bit applications on the computer. This setting is not available for the user interface.
2Opt InDEP is enabled for a limited number of binaries, the kernel, and all Windows-based services. However, it is off by default for all 32-bit applications. A user or administrator must explicitly choose either the **Always On** or the **Opt Out** setting before DEP can be applied to 32-bit applications.
3Opt OutDEP is enabled by default for all 32-bit applications. A user or administrator can explicitly remove support for a 32-bit application by adding the application to an exceptions list.
Code
# Value of DataExecutionPrevention_SupportPolicy for each instance
# Lookup table for DataExecutionPrevention_SupportPolicy (values documented by Microsoft)
$dataExecutionPrevention_SupportPolicyName = @{
    0 = 'Always Off'
    1 = 'Always On'
    2 = 'Opt In'
    3 = 'Opt Out'
}
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, DataExecutionPrevention_SupportPolicy |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'DataExecutionPrevention_SupportPolicy'; Expression = { $dataExecutionPrevention_SupportPolicyName[[int]$_.DataExecutionPrevention_SupportPolicy] } }
    )
Debugbooleanread

Operating system is a checked (debug) build. If True, the debugging version is installed. Checked builds provide error checking, argument verification, and system debugging code. Additional code in a checked binary generates a kernel debugger error message and breaks into the debugger. This helps immediately determine the cause and location of the error. Performance may be affected in a checked build due to the additional code that is executed.

Code
# Value of Debug for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Debug |
    Select-Object -Property CSName, Debug
Descriptionstringread/write

Description of the Windows operating system. Some user interfaces for example, those that allow editing of this description, limit its length to 48 characters.

Code
# Value of Description for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Description |
    Select-Object -Property CSName, Description

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Description on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_OperatingSystem
$setParameters = @{
    InputObject = $instance
    Property    = @{ Description = 'Example' }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
Distributedbooleanread

If True, the operating system is distributed across several computer system nodes. If so, these nodes should be grouped as a cluster.

Code
# Value of Distributed for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Distributed |
    Select-Object -Property CSName, Distributed
EncryptionLeveluint32read

Encryption level for secure transactions: 40-bit, 128-bit, or *n*-bit.

Values (3)
ValueLabelDescription
040-bit
1128-bit
2n-bit
Code
# Value of EncryptionLevel for each instance
# Lookup table for EncryptionLevel (values documented by Microsoft)
$encryptionLevelName = @{
    0 = '40-bit'
    1 = '128-bit'
    2 = 'n-bit'
}
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, EncryptionLevel |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'EncryptionLevel'; Expression = { $encryptionLevelName[[int]$_.EncryptionLevel] } }
    )
ForegroundApplicationBoostuint8read/write

Increase in priority is given to the foreground application. Application boost is implemented by giving an application more execution time slices (quantum lengths).

Values (3)
ValueLabelDescription
0NoneThe system boosts the quantum length by 6.
1MinimumThe system boosts the quantum length by 12.
2MaximumThe system boosts the quantum length by 18.
Code
# Value of ForegroundApplicationBoost for each instance
# Lookup table for ForegroundApplicationBoost (values documented by Microsoft)
$foregroundApplicationBoostName = @{
    0 = 'None'
    1 = 'Minimum'
    2 = 'Maximum'
}
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, ForegroundApplicationBoost |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'ForegroundApplicationBoost'; Expression = { $foregroundApplicationBoostName[[int]$_.ForegroundApplicationBoost] } }
    )

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes ForegroundApplicationBoost on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_OperatingSystem
$setParameters = @{
    InputObject = $instance
    Property    = @{ ForegroundApplicationBoost = 1 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
FreePhysicalMemoryuint64read

Number, in kilobytes, of physical memory currently unused and available.

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

Unit: kilobytes

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

Number, in kilobytes, that can be mapped into the operating system paging files without causing any other pages to be swapped out.

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

Unit: kilobytes

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

Number, in kilobytes, of virtual memory currently unused and available.

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

Unit: kilobytes

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

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

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

This property is obsolete and not supported.

Values (2)
ValueLabelDescription
0Optimize for ApplicationsOptimize memory for applications.
1Optimize for System PerformanceOptimize memory for system performance.
Code
# Value of LargeSystemCache for each instance
# Lookup table for LargeSystemCache (values documented by Microsoft)
$largeSystemCacheName = @{
    0 = 'Optimize for Applications'
    1 = 'Optimize for System Performance'
}
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, LargeSystemCache |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'LargeSystemCache'; Expression = { $largeSystemCacheName[[int]$_.LargeSystemCache] } }
    )
LastBootUpTimedatetimeread

Date and time the operating system was last restarted.

Code
# Value of LastBootUpTime for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, LastBootUpTime |
    Select-Object -Property CSName, LastBootUpTime
LocalDateTimedatetimeread

Operating system version of the local date and time-of-day.

Code
# Value of LocalDateTime for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, LocalDateTime |
    Select-Object -Property CSName, LocalDateTime
Localestringread

Language identifier used by the operating system. A language identifier is a standard international numeric abbreviation for a country/region. Each language has a unique language identifier (LANGID), a 16-bit value that consists of a primary language identifier and a secondary language identifier.

Code
# Value of Locale for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Locale |
    Select-Object -Property CSName, Locale
Manufacturerstringread

Name of the operating system manufacturer. For Windows-based systems, this value is "Microsoft Corporation".

Code
# Value of Manufacturer for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Manufacturer |
    Select-Object -Property CSName, Manufacturer
MaxNumberOfProcessesuint32read

Maximum number of process contexts the operating system can support. The default value set by the provider is 4294967295 (0xFFFFFFFF). 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 4294967295 (0xFFFFFFFF).

Code
# Value of MaxNumberOfProcesses for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, MaxNumberOfProcesses |
    Select-Object -Property CSName, MaxNumberOfProcesses
MaxProcessMemorySizeuint64read

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

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

Unit: kilobytes

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

Multilingual User Interface Pack (MUI Pack ) languages installed on the computer. For example, "en-us". MUI Pack languages are resource files that can be installed on the English version of the operating system. When an MUI Pack is installed, you can change the user interface language to one of 33 supported languages.

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

Operating system instance within a computer system.

Code
# Value of Name for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Name |
    Select-Object -Property CSName, Name
NumberOfLicensedUsersuint32read

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

Code
# Value of NumberOfLicensedUsers for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, NumberOfLicensedUsers |
    Select-Object -Property CSName, NumberOfLicensedUsers
NumberOfProcessesuint32read

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

Code
# Value of NumberOfProcesses for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, NumberOfProcesses |
    Select-Object -Property CSName, NumberOfProcesses
NumberOfUsersuint32read

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

Code
# Value of NumberOfUsers for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, NumberOfUsers |
    Select-Object -Property CSName, NumberOfUsers
OperatingSystemSKUuint32read

Stock Keeping Unit (SKU) number for the operating system. These values are the same as the PRODUCT_* constants defined in WinNT.h that are used with the GetProductInfo function.

The following list lists possible SKU values.

Values (51)
ValueLabelDescription
0PRODUCT_UNDEFINEDUndefined
1PRODUCT_ULTIMATEUltimate Edition, e.g. Windows Vista Ultimate.
2PRODUCT_HOME_BASICHome Basic Edition
3PRODUCT_HOME_PREMIUMHome Premium Edition
4PRODUCT_ENTERPRISEEnterprise Edition
6PRODUCT_BUSINESSBusiness Edition
7PRODUCT_STANDARD_SERVERWindows Server Standard Edition (Desktop Experience installation)
8PRODUCT_DATACENTER_SERVERWindows Server Datacenter Edition (Desktop Experience installation)
9PRODUCT_SMALLBUSINESS_SERVERSmall Business Server Edition
10PRODUCT_ENTERPRISE_SERVEREnterprise Server Edition
11PRODUCT_STARTERStarter Edition
12PRODUCT_DATACENTER_SERVER_COREDatacenter Server Core Edition
13PRODUCT_STANDARD_SERVER_COREStandard Server Core Edition
14PRODUCT_ENTERPRISE_SERVER_COREEnterprise Server Core Edition
17PRODUCT_WEB_SERVERWeb Server Edition
19PRODUCT_HOME_SERVERHome Server Edition
20PRODUCT_STORAGE_EXPRESS_SERVERStorage Express Server Edition
21PRODUCT_STORAGE_STANDARD_SERVERWindows Storage Server Standard Edition (Desktop Experience installation)
22PRODUCT_STORAGE_WORKGROUP_SERVERWindows Storage Server Workgroup Edition (Desktop Experience installation)
23PRODUCT_STORAGE_ENTERPRISE_SERVERStorage Enterprise Server Edition
24PRODUCT_SERVER_FOR_SMALLBUSINESSServer For Small Business Edition
25PRODUCT_SMALLBUSINESS_SERVER_PREMIUMSmall Business Server Premium Edition
27PRODUCT_ENTERPRISE_NWindows Enterprise Edition
28PRODUCT_ULTIMATE_NWindows Ultimate Edition
29PRODUCT_WEB_SERVER_COREWindows Server Web Server Edition (Server Core installation)
36PRODUCT_STANDARD_SERVER_VWindows Server Standard Edition without Hyper-V
37PRODUCT_DATACENTER_SERVER_VWindows Server Datacenter Edition without Hyper-V (full installation)
38PRODUCT_ENTERPRISE_SERVER_VWindows Server Enterprise Edition without Hyper-V (full installation)
39PRODUCT_DATACENTER_SERVER_CORE_VWindows Server Datacenter Edition without Hyper-V (Server Core installation)
40PRODUCT_STANDARD_SERVER_CORE_VWindows Server Standard Edition without Hyper-V (Server Core installation)
41PRODUCT_ENTERPRISE_SERVER_CORE_VWindows Server Enterprise Edition without Hyper-V (Server Core installation)
42PRODUCT_HYPERVMicrosoft Hyper-V Server
43PRODUCT_STORAGE_EXPRESS_SERVER_COREStorage Server Express Edition (Server Core installation)
44PRODUCT_STORAGE_STANDARD_SERVER_COREStorage Server Standard Edition (Server Core installation)
45PRODUCT_STORAGE_WORKGROUP_SERVER_COREStorage Server Workgroup Edition (Server Core installation)
46PRODUCT_STORAGE_ENTERPRISE_SERVER_COREStorage Server Enterprise Edition (Server Core installation)
48PRODUCT_PROFESSIONALWindows Professional
50PRODUCT_SB_SOLUTION_SERVERWindows Server Essentials (Desktop Experience installation)
63PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORESmall Business Server Premium (Server Core installation)
64PRODUCT_CLUSTER_SERVER_VWindows Compute Cluster Server without Hyper-V
97PRODUCT_CORE_ARMWindows RT
101PRODUCT_COREWindows Home
103PRODUCT_PROFESSIONAL_WMCWindows Professional with Media Center
104PRODUCT_MOBILE_COREWindows Mobile
123PRODUCT_IOTUAPWindows IoT (Internet of Things) Core
143PRODUCT_DATACENTER_NANO_SERVERWindows Server Datacenter Edition (Nano Server installation)
144PRODUCT_STANDARD_NANO_SERVERWindows Server Standard Edition (Nano Server installation)
147PRODUCT_DATACENTER_WS_SERVER_COREWindows Server Datacenter Edition (Server Core installation)
148PRODUCT_STANDARD_WS_SERVER_COREWindows Server Standard Edition (Server Core installation)
175PRODUCT_ENTERPRISE_FOR_VIRTUAL_DESKTOPSWindows Enterprise for Virtual Desktops (Azure Virtual Desktop)
407PRODUCT_DATACENTER_SERVER_AZURE_EDITIONWindows Server Datacenter: Azure Edition
Code
# Value of OperatingSystemSKU for each instance
# Lookup table for OperatingSystemSKU (values documented by Microsoft)
$operatingSystemSKUName = @{
    0 = 'PRODUCT_UNDEFINED'
    1 = 'PRODUCT_ULTIMATE'
    2 = 'PRODUCT_HOME_BASIC'
    3 = 'PRODUCT_HOME_PREMIUM'
    4 = 'PRODUCT_ENTERPRISE'
    6 = 'PRODUCT_BUSINESS'
    7 = 'PRODUCT_STANDARD_SERVER'
    8 = 'PRODUCT_DATACENTER_SERVER'
    9 = 'PRODUCT_SMALLBUSINESS_SERVER'
    10 = 'PRODUCT_ENTERPRISE_SERVER'
    11 = 'PRODUCT_STARTER'
    12 = 'PRODUCT_DATACENTER_SERVER_CORE'
    13 = 'PRODUCT_STANDARD_SERVER_CORE'
    14 = 'PRODUCT_ENTERPRISE_SERVER_CORE'
    17 = 'PRODUCT_WEB_SERVER'
    19 = 'PRODUCT_HOME_SERVER'
    20 = 'PRODUCT_STORAGE_EXPRESS_SERVER'
    21 = 'PRODUCT_STORAGE_STANDARD_SERVER'
    22 = 'PRODUCT_STORAGE_WORKGROUP_SERVER'
    23 = 'PRODUCT_STORAGE_ENTERPRISE_SERVER'
    24 = 'PRODUCT_SERVER_FOR_SMALLBUSINESS'
    25 = 'PRODUCT_SMALLBUSINESS_SERVER_PREMIUM'
    27 = 'PRODUCT_ENTERPRISE_N'
    28 = 'PRODUCT_ULTIMATE_N'
    29 = 'PRODUCT_WEB_SERVER_CORE'
    36 = 'PRODUCT_STANDARD_SERVER_V'
    37 = 'PRODUCT_DATACENTER_SERVER_V'
    38 = 'PRODUCT_ENTERPRISE_SERVER_V'
    39 = 'PRODUCT_DATACENTER_SERVER_CORE_V'
    40 = 'PRODUCT_STANDARD_SERVER_CORE_V'
    41 = 'PRODUCT_ENTERPRISE_SERVER_CORE_V'
    42 = 'PRODUCT_HYPERV'
    43 = 'PRODUCT_STORAGE_EXPRESS_SERVER_CORE'
    44 = 'PRODUCT_STORAGE_STANDARD_SERVER_CORE'
    45 = 'PRODUCT_STORAGE_WORKGROUP_SERVER_CORE'
    46 = 'PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE'
    48 = 'PRODUCT_PROFESSIONAL'
    50 = 'PRODUCT_SB_SOLUTION_SERVER'
    63 = 'PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE'
    64 = 'PRODUCT_CLUSTER_SERVER_V'
    97 = 'PRODUCT_CORE_ARM'
    101 = 'PRODUCT_CORE'
    103 = 'PRODUCT_PROFESSIONAL_WMC'
    104 = 'PRODUCT_MOBILE_CORE'
    123 = 'PRODUCT_IOTUAP'
    143 = 'PRODUCT_DATACENTER_NANO_SERVER'
    144 = 'PRODUCT_STANDARD_NANO_SERVER'
    147 = 'PRODUCT_DATACENTER_WS_SERVER_CORE'
    148 = 'PRODUCT_STANDARD_WS_SERVER_CORE'
    175 = 'PRODUCT_ENTERPRISE_FOR_VIRTUAL_DESKTOPS'
    407 = 'PRODUCT_DATACENTER_SERVER_AZURE_EDITION'
}
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, OperatingSystemSKU |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'OperatingSystemSKU'; Expression = { $operatingSystemSKUName[[int]$_.OperatingSystemSKU] } }
    )
Organizationstringread

Company name for the registered user of the operating system.

Example: "Microsoft Corporation"

Code
# Value of Organization for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Organization |
    Select-Object -Property CSName, Organization
OSArchitecturestringread

Architecture of the operating system, as opposed to the processor. This property can be localized.

Example: 32-bit

Code
# Value of OSArchitecture for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, OSArchitecture |
    Select-Object -Property CSName, OSArchitecture
OSLanguageuint32read

Language version of the operating system installed. The following list lists the possible values. Example: 0x0807 (German, Switzerland).

Values (122)
ValueLabelDescription
1Arabic
4Chinese (Simplified)– China
9English
1025Arabic – Saudi Arabia
1026Bulgarian
1027Catalan
1028Chinese (Traditional) – Taiwan
1029Czech
1030Danish
1031German – Germany
1032Greek
1033English – United States
1034Spanish – Traditional Sort
1035Finnish
1036French – France
1037Hebrew
1038Hungarian
1039Icelandic
1040Italian – Italy
1041Japanese
1042Korean
1043Dutch – Netherlands
1044Norwegian – Bokmal
1045Polish
1046Portuguese – Brazil
1047Rhaeto-Romanic
1048Romanian
1049Russian
1050Croatian
1051Slovak
1052Albanian
1053Swedish
1054Thai
1055Turkish
1056Urdu
1057Indonesian
1058Ukrainian
1059Belarusian
1060Slovenian
1061Estonian
1062Latvian
1063Lithuanian
1065Persian
1066Vietnamese
1069Basque (Basque)
1070Serbian
1071Macedonian (North Macedonia)
1072Sutu
1073Tsonga
1074Tswana
1076Xhosa
1077Zulu
1078Afrikaans
1080Faeroese
1081Hindi
1082Maltese
1084Scottish Gaelic (United Kingdom)
1085Yiddish
1086Malay – Malaysia
2049Arabic – Iraq
2052Chinese (Simplified) – PRC
2055German – Switzerland
2057English – United Kingdom
2058Spanish – Mexico
2060French – Belgium
2064Italian – Switzerland
2067Dutch – Belgium
2068Norwegian – Nynorsk
2070Portuguese – Portugal
2072Romanian – Moldova
2073Russian – Moldova
2074Serbian – Latin
2077Swedish – Finland
3073Arabic – Egypt
3076Chinese (Traditional) – Hong Kong SAR
3079German – Austria
3081English – Australia
3082Spanish – International Sort
3084French – Canada
3098Serbian – Cyrillic
4097Arabic – Libya
4100Chinese (Simplified) – Singapore
4103German – Luxembourg
4105English – Canada
4106Spanish – Guatemala
4108French – Switzerland
5121Arabic – Algeria
5127German – Liechtenstein
5129English – New Zealand
5130Spanish – Costa Rica
5132French – Luxembourg
6145Arabic – Morocco
6153English – Ireland
6154Spanish – Panama
7169Arabic – Tunisia
7177English – South Africa
7178Spanish – Dominican Republic
8193Arabic – Oman
8201English – Jamaica
8202Spanish – Venezuela
9217Arabic – Yemen
9226Spanish – Colombia
10241Arabic – Syria
10249English – Belize
10250Spanish – Peru
11265Arabic – Jordan
11273English – Trinidad
11274Spanish – Argentina
12289Arabic – Lebanon
12298Spanish – Ecuador
13313Arabic – Kuwait
13322Spanish – Chile
14337Arabic – U.A.E.
14346Spanish – Uruguay
15361Arabic – Bahrain
15370Spanish – Paraguay
16385Arabic – Qatar
16394Spanish – Bolivia
17418Spanish – El Salvador
18442Spanish – Honduras
19466Spanish – Nicaragua
20490Spanish – Puerto Rico
Code
# Value of OSLanguage for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, OSLanguage |
    Select-Object -Property CSName, OSLanguage
OSProductSuiteuint32read

Installed and licensed system product additions to the operating system. For example, the value of 146 (0x92) for OSProductSuite indicates Enterprise, Terminal Services, and Data Center (bits one, four, and seven set). The following list lists possible values.

Values (13) — bit field
ValueLabelDescription
1Microsoft Small Business Server was once installed, but may have been upgraded to another version of Windows.
2Windows Server 2008 Enterprise is installed.
4Windows BackOffice components are installed.
8Communication Server is installed.
16Terminal Services is installed.
32Microsoft Small Business Server is installed with the restrictive client license.
64Windows Embedded is installed.
128A Datacenter edition is installed.
256Terminal Services is installed, but only one interactive session is supported.
512Windows Home Edition is installed.
1024Web Server Edition is installed.
8192Storage Server Edition is installed.
16384Compute Cluster Edition is installed.
Code
# Value of OSProductSuite for each instance
# OSProductSuite is a bit field: each set bit is decoded with -band
$oSProductSuiteFlag = @{
    1 = 'Microsoft Small Business Server was once installed, but may…'
    2 = 'Windows Server 2008 Enterprise is installed'
    4 = 'Windows BackOffice components are installed'
    8 = 'Communication Server is installed'
    16 = 'Terminal Services is installed'
    32 = 'Microsoft Small Business Server is installed with the…'
    64 = 'Windows Embedded is installed'
    128 = 'A Datacenter edition is installed'
    256 = 'Terminal Services is installed, but only one interactive…'
    512 = 'Windows Home Edition is installed'
    1024 = 'Web Server Edition is installed'
    8192 = 'Storage Server Edition is installed'
    16384 = 'Compute Cluster Edition is installed'
}
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, OSProductSuite |
    Select-Object -Property @(
        'CSName'
        @{
            Name       = 'OSProductSuite'
            Expression = {
                $value = $_.OSProductSuite
                $oSProductSuiteFlag.Keys |
                    Sort-Object |
                    Where-Object -FilterScript { $value -band $_ } |
                    ForEach-Object -Process { $oSProductSuiteFlag[$_] }
            }
        }
    )
OSTypeuint16read

Type of operating system. The following list identifies the possible values.

Values (63)
ValueLabelDescription
0Unknown
1Other
2MACOSMACROS
3ATTUNIX
4DGUX
5DECNT
6Digital Unix
7OpenVMS
8HPUX
9AIX
10MVS
11OS400
12OS/2
13JavaVM
14MSDOS
15WIN3x
16WIN95
17WIN98
18WINNT
19WINCE
20NCR3000
21NetWare
22OSF
23DC/OS
24Reliant UNIX
25SCO UnixWare
26SCO OpenServer
27Sequent
28IRIX
29Solaris
30SunOS
31U6000
32ASERIES
33TandemNSK
34TandemNT
35BS2000
36LINUX
37Lynx
38XENIX
39VM/ESA
40Interactive UNIX
41BSDUNIX
42FreeBSD
43NetBSD
44GNU Hurd
45OS9
46MACH Kernel
47Inferno
48QNX
49EPOC
50IxWorks
51VxWorks
52MiNT
53BeOS
54HP MPE
55NextStep
56PalmPilot
57Rhapsody
58Windows 2000
59Dedicated
60OS/390
61VSE
62TPF
Code
# Value of OSType for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, OSType |
    Select-Object -Property CSName, OSType
OtherTypeDescriptionstringread

Additional description for the current operating system version.

Code
# Value of OtherTypeDescription for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, OtherTypeDescription |
    Select-Object -Property CSName, OtherTypeDescription
PAEEnabledbooleanread

If True, the physical address extensions (PAE) are enabled by the operating system running on Intel processors. PAE allows applications to address more than 4 GB of physical memory. When PAE is enabled, the operating system uses three-level linear address translation rather than two-level. Providing more physical memory to an application reduces the need to swap memory to the page file and increases performance. To enable, PAE, use the "/PAE" switch in the Boot.ini file. For more information about the Physical Address Extension feature, see Physical Address Extension.

Code
# Value of PAEEnabled for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, PAEEnabled |
    Select-Object -Property CSName, PAEEnabled
PlusProductIDstringread

Not supported.

Code
# Value of PlusProductID for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, PlusProductID |
    Select-Object -Property CSName, PlusProductID
PlusVersionNumberstringread

Not supported.

Code
# Value of PlusVersionNumber for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, PlusVersionNumber |
    Select-Object -Property CSName, PlusVersionNumber
PortableOperatingSystembooleanread

Specifies whether the operating system booted from an external USB device. If true, the operating system has detected it is booting on a supported locally connected storage device.

Windows Server 2008 R2, Windows 7, Windows Server 2008 and Windows Vista: This property is not supported before Windows 8 and Windows Server 2012.

Code
# Value of PortableOperatingSystem for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, PortableOperatingSystem |
    Select-Object -Property CSName, PortableOperatingSystem
Primarybooleanread

Specifies whether this is the primary operating system.

Code
# Value of Primary for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Primary |
    Select-Object -Property CSName, Primary
ProductTypeuint32read

Additional system information.

Values (3)
ValueLabelDescription
1Work Station
2Domain Controller
3Server
Code
# Value of ProductType for each instance
# Lookup table for ProductType (values documented by Microsoft)
$productTypeName = @{
    1 = 'Work Station'
    2 = 'Domain Controller'
    3 = 'Server'
}
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, ProductType |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'ProductType'; Expression = { $productTypeName[[int]$_.ProductType] } }
    )
QuantumLengthuint8read/write

Not supported

Windows Server 2008 and Windows Vista:

The QuantumLength property defines the number of clock ticks per quantum. A quantum is a unit of execution time that the scheduler is allowed to give to an application before switching to other applications. When a thread runs one quantum, the kernel preempts it and moves it to the end of a queue for applications with equal priorities. The actual length of a thread's quantum varies across different Windows platforms. For Windows NT/Windows 2000 only.

The possible values are.

Values (3)
ValueLabelDescription
0Unknown
1One tick
2Two ticks
Code
# Value of QuantumLength for each instance
# Lookup table for QuantumLength (values documented by Microsoft)
$quantumLengthName = @{
    0 = 'Unknown'
    1 = 'One tick'
    2 = 'Two ticks'
}
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, QuantumLength |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'QuantumLength'; Expression = { $quantumLengthName[[int]$_.QuantumLength] } }
    )

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes QuantumLength on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_OperatingSystem
$setParameters = @{
    InputObject = $instance
    Property    = @{ QuantumLength = 1 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
QuantumTypeuint8read/write

Not supported

Windows Server 2008 and Windows Vista:

The QuantumType property specifies either fixed or variable length quantums. Windows defaults to variable length quantums where the foreground application has a longer quantum than the background applications. Windows Server defaults to fixed-length quantums. A quantum is a unit of execution time that the scheduler is allowed to give to an application before switching to another application. When a thread runs one quantum, the kernel preempts it and moves it to the end of a queue for applications with equal priorities. The actual length of a thread's quantum varies across different Windows platforms.

The possible values are.

Values (3)
ValueLabelDescription
0Unknown
1Fixed
2Variable
Code
# Value of QuantumType for each instance
# Lookup table for QuantumType (values documented by Microsoft)
$quantumTypeName = @{
    0 = 'Unknown'
    1 = 'Fixed'
    2 = 'Variable'
}
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, QuantumType |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'QuantumType'; Expression = { $quantumTypeName[[int]$_.QuantumType] } }
    )

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes QuantumType on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_OperatingSystem
$setParameters = @{
    InputObject = $instance
    Property    = @{ QuantumType = 1 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
RegisteredUserstringread

Name of the registered user of the operating system.

Example: "Ben Smith"

Code
# Value of RegisteredUser for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, RegisteredUser |
    Select-Object -Property CSName, RegisteredUser
SerialNumberstringread

Operating system product serial identification number.

Example: "10497-OEM-0031416-71674"

Code
# Value of SerialNumber for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, SerialNumber |
    Select-Object -Property CSName, SerialNumber
ServicePackMajorVersionuint16read

Major version number of the service pack installed on the computer system. If no service pack has been installed, the value is 0 (zero).

Code
# Value of ServicePackMajorVersion for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, ServicePackMajorVersion |
    Select-Object -Property CSName, ServicePackMajorVersion
ServicePackMinorVersionuint16read

Minor version number of the service pack installed on the computer system. If no service pack has been installed, the value is 0 (zero).

Code
# Value of ServicePackMinorVersion for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, ServicePackMinorVersion |
    Select-Object -Property CSName, ServicePackMinorVersion
SizeStoredInPagingFilesuint64read

Total number of kilobytes that can be stored in the operating system paging files—0 (zero) indicates that there are no paging files. Be aware that this number does not represent the actual physical size of the paging file on disk.

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

Unit: kilobytes

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

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

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

Bit flags that identify the product suites available on the system.

For example, to specify both Personal and BackOffice, set SuiteMask to 4 | 512 or 516.

1

Small Business

2

Enterprise

4

BackOffice

8

Communications

16

Terminal Services

32

Small Business Restricted

64

Embedded Edition

128

Datacenter Edition

256

Single User

512

Home Edition

1024

Web Server Edition

Code
# Value of SuiteMask for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, SuiteMask |
    Select-Object -Property CSName, SuiteMask
SystemDevicestringread

Physical disk partition on which the operating system is installed.

Code
# Value of SystemDevice for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, SystemDevice |
    Select-Object -Property CSName, SystemDevice
SystemDirectorystringread

System directory of the operating system.

Example: "C:\WINDOWS\SYSTEM32"

Code
# Value of SystemDirectory for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, SystemDirectory |
    Select-Object -Property CSName, SystemDirectory
SystemDrivestringread

Letter of the disk drive on which the operating system resides. Example: "C:"

Code
# Value of SystemDrive for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, SystemDrive |
    Select-Object -Property CSName, SystemDrive
TotalSwapSpaceSizeuint64read

Total swap space in kilobytes. This value may be NULL (unspecified) if the swap space is not distinguished from page files. However, some operating systems distinguish these concepts. For example, in UNIX, whole processes can be swapped out 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
# Value of TotalSwapSpaceSize for each instance
# TotalSwapSpaceSize is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, TotalSwapSpaceSize |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'TotalSwapSpaceSizeGB'; Expression = { [math]::Round($_.TotalSwapSpaceSize / 1MB, 2) } }
    )
TotalVirtualMemorySizeuint64read

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

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

Unit: kilobytes

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

Total amount, in kilobytes, of physical memory 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
# Value of TotalVisibleMemorySize for each instance
# TotalVisibleMemorySize is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, TotalVisibleMemorySize |
    Select-Object -Property @(
        'CSName'
        @{ Name = 'TotalVisibleMemorySizeGB'; Expression = { [math]::Round($_.TotalVisibleMemorySize / 1MB, 2) } }
    )
Versionstringread

Version number of the operating system.

Example: "4.0"

Code
# Value of Version for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, Version |
    Select-Object -Property CSName, Version
WindowsDirectorystringread

Windows directory of the operating system.

Example: "C:\WINDOWS"

Code
# Value of WindowsDirectory for each instance
Get-CimInstance -ClassName Win32_OperatingSystem -Property CSName, WindowsDirectory |
    Select-Object -Property CSName, WindowsDirectory

Methods

Reboot #

Shuts down and then restarts the computer system.

uint32 Reboot();

Return values

ValueLabelDescription
0Success
1..4294967295Other

Call the Reboot method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_OperatingSystem
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'Reboot'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $result.ReturnValue
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

SetDateTime #

Allows the computer date and time to be set.

uint32 SetDateTime([in] datetime LocalDatetime);

Parameters

ParameterTypeDirectionDescription
LocalDatetimedatetimein

Value of the current time.

Return values

ValueLabelDescription
0Success
1..4294967295Other

Call the SetDateTime method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_OperatingSystem
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'SetDateTime'
    Arguments   = @{ LocalDatetime = (Get-Date) }
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $result.ReturnValue
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

Shutdown #

Unloads programs and DLLs to the point where it is safe to turn off the computer.

uint32 Shutdown();

Return values

ValueLabelDescription
0Success
1..4294967295Other

Call the Shutdown method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_OperatingSystem
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'Shutdown'
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $result.ReturnValue
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

Win32Shutdown #

Provides the full set of shutdown options supported by Windows operating systems.

uint32 Win32Shutdown([in] sint32 Flags, [in] sint32 Reserved);

Parameters

ParameterTypeDirectionDescription
Flagssint32in

Bitmapped set of flags to shut the computer down. To force a command, add the Force flag (4) to the command value. Using Force in conjunction with Shutdown or Reboot on a remote computer immediately shuts down everything (including WMI, COM, and so on), or reboots the remote computer. This results in an indeterminate return value.

Reservedsint32in

A means to extend Win32Shutdown. Currently, the *Reserved* parameter is ignored.

Return values

ValueLabelDescription
0Success
1–4294967295Other

Call the Win32Shutdown method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_OperatingSystem
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'Win32Shutdown'
    Arguments   = @{
        Flags    = 4
        Reserved = 0
    }
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $result.ReturnValue
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

Win32ShutdownTracker #

Provides the same set of shutdown options supported by the Win32Shutdown method in Win32_OperatingSystem, but also allows you to specify comments, a reason for shutdown, or a timeout.

uint32 Win32ShutdownTracker(
    [in] uint32 Timeout,
    [in] string Comment,
    [in] uint32 ReasonCode,
    [in] sint32 Flags
);

Parameters

ParameterTypeDirectionDescription
Timeoutuint32in

Time, in seconds, before shutdown takes place. The default value is 0 (zero).

Commentstringin

Message to display in the shutdown dialog box that is also stored as a comment in the event log entry.

ReasonCodeuint32in

Reason for initiating the shutdown.

Flagssint32in

Bitmapped set of flags to shut the computer down. To force a command, add the Force flag (4) to the command value. Using Force in conjunction with Shutdown or Reboot on a remote computer immediately shuts down everything (including WMI, COM, and so on), or reboots the remote computer. This results in an indeterminate return value.

Return values

ValueLabelDescription
0Success
1–4294967295Other

Call the Win32ShutdownTracker method

review before running
# Warning: this method can change the system. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_OperatingSystem
$methodParameters = @{
    InputObject = $instance
    MethodName  = 'Win32ShutdownTracker'
    Arguments   = @{
        Timeout    = 0
        Comment    = 'Example'
        ReasonCode = 0
        Flags      = 4
    }
    WhatIf      = $true  # Remove this line to actually run the method
}
$result = Invoke-CimMethod @methodParameters

# With -WhatIf nothing runs and no result is returned
if ($result) {
    $result.ReturnValue
}

This method can change the system. The -WhatIf parameter shows the operation without running it: remove it only after checking.

Remarks

The Win32_OperatingSystem class is derived from CIM_OperatingSystem.

Any operating system that can be installed on a computer that can run a Windows-based operating system is a descendant or member of this class. Win32_OperatingSystem is a singleton class. To get the single instance, use "@" for the key.

Unlike most of the other WMI classes generated by MgmtClassGen, the OperatingSystem.CreateInstance() method will return a blank OperatingSystem object. Therefore, if you are using C# with MgmtClassGen, you can use the following code:

```CSharp

WMI.OperatingSystem os = new ROOT.CIMV2.win32.OperatingSystem();

```

Inheritance

Superclass chain

  1. CIM_ManagedSystemElement
  2. CIM_LogicalElement
  3. CIM_OperatingSystem
  4. Win32_OperatingSystem

Known subclasses

No known subclass.

Requirements

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

Singleton Dynamic Provider("CIMWin32") SupportsUpdate UUID("{8502C4DE-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.