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, ProviderNameExamples
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, FlagsProperties
| Name | Type | Access | Description |
|---|---|---|---|
| Description# | string | read | Any user-defined string that describes an error or operational status. Code |
| Operation# | string | read | 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 |
| ParameterInfo# | string | read | 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 |
| PrivilegesNotHeld# | string[] | 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 |
| PrivilegesRequired# | string[] | read | Listing of all of the privileges required to perform an operation. This includes values from the PrivilegesNotHeld property. Example: "SE_SHUTDOWN_NAME" Code |
| ProviderName# | string | read | 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 |
| StatusCode# | uint32 | read | 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 |
Remarks
The Win32_PrivilegesStatus class is derived from __ExtendedStatus.
Inheritance
Superclass chain
- __NotifyStatus
- __ExtendedStatus
- 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
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.