__ExtendedStatus

Extended Status

Used to report detailed status and error information.

On this page

Main example

List instances

# All instances of __ExtendedStatus, with the main properties
Get-CimInstance -ClassName __ExtendedStatus -Namespace 'root' |
    Select-Object -Property Description, Operation, ParameterInfo, ProviderName

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 {
    $cimParameters = @{
        CimSession = $cimSession
        ClassName  = '__ExtendedStatus'
        Namespace  = 'root'
    }
    Get-CimInstance @cimParameters |
        Select-Object -Property Description, Operation, ParameterInfo, ProviderName
} 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 __ExtendedStatus -Namespace 'root'
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

5 of 5 properties
NameTypeAccessDescription
Descriptionstringread

Any user-defined string that describes an error or operational status.

Code
# Value of Description for each instance
$cimParameters = @{
    ClassName = '__ExtendedStatus'
    Namespace = 'root'
    Property  = 'Description'
}
Get-CimInstance @cimParameters |
    Select-Object -Property Description
Operationstringread

Operation that takes place at the time of a failure or anomaly. Typically, Windows Management Instrumentation (WMI) sets this property to the name of a COM API for WMI method such as the following: IWbemServices::CreateInstanceEnum.

Code
# Value of Operation for each instance
$cimParameters = @{
    ClassName = '__ExtendedStatus'
    Namespace = 'root'
    Property  = 'Operation'
}
Get-CimInstance @cimParameters |
    Select-Object -Property Operation
ParameterInfostringread

Parameters involved in an error or status change. For example, if an application attempts to retrieve a class that does not exist, this property is set to the offending class name.

Code
# Value of ParameterInfo for each instance
$cimParameters = @{
    ClassName = '__ExtendedStatus'
    Namespace = 'root'
    Property  = 'ParameterInfo'
}
Get-CimInstance @cimParameters |
    Select-Object -Property ParameterInfo
ProviderNamestringread

Identifies the provider that causes or reports an error or status change. If a provider is not involved, this string is set to "Windows Management".

Code
# Value of ProviderName for each instance
$cimParameters = @{
    ClassName = '__ExtendedStatus'
    Namespace = 'root'
    Property  = 'ProviderName'
}
Get-CimInstance @cimParameters |
    Select-Object -Property ProviderName
StatusCodeuint32read

Contains an error or information code for an operation. This can be any value defined by the provider, but the value 0 (zero) is usually reserved to indicate success. This property is inherited from __NotifyStatus.

Code
# Value of StatusCode for each instance
$cimParameters = @{
    ClassName = '__ExtendedStatus'
    Namespace = 'root'
    Property  = 'StatusCode'
}
Get-CimInstance @cimParameters |
    Select-Object -Property StatusCode

Remarks

The __ExtendedStatus class is derived from the __NotifyStatus class.

Use the __ExtendedStatus class to report information that is more complex than a simple result code. Providers can derive their own classes from __ExtendedStatus if they require more properties to describe the errors.

The StatusCode property, inherited from the __NotifyStatus parent class, is an unsigned integer that represents the error or status value. When instances of this class are returned from a method by a dynamic provider, the StatusCode and Description properties are set by the provider, and the other properties are set by WMI.

Inheritance

Superclass chain

  1. __NotifyStatus
  2. __ExtendedStatus

Known subclasses

Requirements

Namespace
root
Minimum client
Windows Vista
Minimum server
Windows Server 2008
DLL
All

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.