Win32_PrivilegesStatus

Win32 Privileges Status

The Win32_PrivilegesStatus WMI class reports information about privileges required to complete an operation. It may be returned when an operation failed or when a partially populated instance has been returned.

On this page

Main example

List instances

# All instances of Win32_PrivilegesStatus, with the main properties
Get-CimInstance -ClassName Win32_PrivilegesStatus -Namespace 'root/wmi' |
    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  = 'Win32_PrivilegesStatus'
        Namespace  = 'root/wmi'
    }
    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 Win32_PrivilegesStatus -Namespace 'root/wmi'
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

7 of 7 properties
NameTypeAccessDescription
Descriptionstringread

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

Code
# Value of Description for each instance
$cimParameters = @{
    ClassName = 'Win32_PrivilegesStatus'
    Namespace = 'root/wmi'
    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 = 'Win32_PrivilegesStatus'
    Namespace = 'root/wmi'
    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 = 'Win32_PrivilegesStatus'
    Namespace = 'root/wmi'
    Property  = 'ParameterInfo'
}
Get-CimInstance @cimParameters |
    Select-Object -Property ParameterInfo
PrivilegesNotHeldstring[]read

Listing required access privileges missing to complete an operation. The types of access privileges can be found under the Windows Privileges.

Example: "SE_SHUTDOWN_NAME"

Code
# Value of PrivilegesNotHeld for each instance
# PrivilegesNotHeld is an array: -ExpandProperty returns its items one by one
$cimParameters = @{
    ClassName = 'Win32_PrivilegesStatus'
    Namespace = 'root/wmi'
    Property  = 'PrivilegesNotHeld'
}
Get-CimInstance @cimParameters |
    Select-Object -ExpandProperty PrivilegesNotHeld
PrivilegesRequiredstring[]read

Listing of all of the privileges required to perform an operation. This includes values from the PrivilegesNotHeld property.

Example: "SE_SHUTDOWN_NAME"

Code
# Value of PrivilegesRequired for each instance
# PrivilegesRequired is an array: -ExpandProperty returns its items one by one
$cimParameters = @{
    ClassName = 'Win32_PrivilegesStatus'
    Namespace = 'root/wmi'
    Property  = 'PrivilegesRequired'
}
Get-CimInstance @cimParameters |
    Select-Object -ExpandProperty PrivilegesRequired
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 = 'Win32_PrivilegesStatus'
    Namespace = 'root/wmi'
    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 = 'Win32_PrivilegesStatus'
    Namespace = 'root/wmi'
    Property  = 'StatusCode'
}
Get-CimInstance @cimParameters |
    Select-Object -Property StatusCode

Remarks

The Win32_PrivilegesStatus class is derived from __ExtendedStatus.

Inheritance

Superclass chain

  1. __NotifyStatus
  2. __ExtendedStatus
  3. Win32_PrivilegesStatus

Known subclasses

No known subclass.

Requirements

Namespace
root/wmi
Minimum client
Windows Vista
Minimum server
Windows Server 2008
MOF file
Wmi.mof
DLL
Root\WMI
Class qualifiers

UUID("{BE46D060-7A7C-11d2-BC85-00104B2CF71C}")

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.