Main example
List instances
# Abstract class: Get-CimInstance returns the instances of its subclasses
Get-CimInstance -ClassName __ProviderRegistration -Namespace 'root' |
Select-Object -Property providerAbstract class: it has no instances of its own. Get-CimInstance returns the instances of its subclasses (__EventConsumerProviderRegistration, __EventProviderRegistration, __MethodProviderRegistration, __ObjectProviderRegistration, …).
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 = '__ProviderRegistration'
Namespace = 'root'
}
Get-CimInstance @cimParameters |
Select-Object -Property provider
} 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 __ProviderRegistration -Namespace 'root'
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, FlagsProperties
| Name | Type | Access | Description |
|---|---|---|---|
| provider# | __Provider | read | Reference to an instance of __Provider representing the object path to the provider. Code |
Remarks
The __ProviderRegistration class is derived from __SystemClass, which has no properties.
Instances of the __ProviderRegistration system class are never created. The classes that providers use to create instances for registration derive either directly or indirectly from this class. These classes are:
__ClassProviderRegistration
__EventConsumerProviderRegistration
__EventProviderRegistration
__InstanceProviderRegistration
__MethodProviderRegistration
__ObjectProviderRegistration
__PropertyProviderRegistration
Only administrators can register or delete a provider by creating an instance of __Win32Provider and registering it.
Inheritance
Superclass chain
- __SystemClass
- __ProviderRegistration
Known subclasses
Requirements
- Namespace
- root
- Minimum client
- Windows Vista
- Minimum server
- Windows Server 2008
- DLL
- All
Class qualifiers
abstract
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.