__ProviderHostQuotaConfiguration

Provider Host Quota Configuration

Allows limits to be set on host process usage of system resources.

On this page

Main example

List instances

# All instances of __ProviderHostQuotaConfiguration, with the main properties
Get-CimInstance -ClassName __ProviderHostQuotaConfiguration -Namespace 'root' |
    Select-Object -Property @(
        'HandlesPerHost'
        @{ Name = 'MemoryAllHostsGB'; Expression = { [math]::Round($_.MemoryAllHosts / 1GB, 2) } }
        'MemoryPerHost'
        'ProcessLimitAllHosts'
    )

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  = '__ProviderHostQuotaConfiguration'
        Namespace  = 'root'
    }
    Get-CimInstance @cimParameters |
        Select-Object -Property @(
            'HandlesPerHost'
            @{ Name = 'MemoryAllHostsGB'; Expression = { [math]::Round($_.MemoryAllHosts / 1GB, 2) } }
            'MemoryPerHost'
            'ProcessLimitAllHosts'
        )
} 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 __ProviderHostQuotaConfiguration -Namespace 'root'
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

5 of 5 properties
NameTypeAccessDescription
HandlesPerHostuint32read/write

Number of kernel object handles each host can have.

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

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

# Warning: changes HandlesPerHost on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __ProviderHostQuotaConfiguration -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ HandlesPerHost = 0 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
MemoryAllHostsuint64read/write

Combined amount of private memory in bytes that can be held by all hosts.

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

Code
# Value of MemoryAllHosts for each instance
# MemoryAllHosts is expressed in bytes: converted to GB
$cimParameters = @{
    ClassName = '__ProviderHostQuotaConfiguration'
    Namespace = 'root'
    Property  = 'MemoryAllHosts'
}
Get-CimInstance @cimParameters |
    Select-Object -Property @(
        @{ Name = 'MemoryAllHostsGB'; Expression = { [math]::Round($_.MemoryAllHosts / 1GB, 2) } }
    )

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

# Warning: changes MemoryAllHosts on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __ProviderHostQuotaConfiguration -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ MemoryAllHosts = 0 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
MemoryPerHostuint64read/write

Amount of private memory that can be held by each host.

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

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

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

# Warning: changes MemoryPerHost on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __ProviderHostQuotaConfiguration -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ MemoryPerHost = 0 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
ProcessLimitAllHostsuint32read/write

Total number of host processes that can be executing concurrently.

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

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

# Warning: changes ProcessLimitAllHosts on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __ProviderHostQuotaConfiguration -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ ProcessLimitAllHosts = 0 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
ThreadsPerHostuint32read/write

Number of threads owned by any one host.

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

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

# Warning: changes ThreadsPerHost on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __ProviderHostQuotaConfiguration -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ ThreadsPerHost = 0 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters

Remarks

The properties that represent limits can be changed but because the class is a singleton, all the provider hosts share the same limits.

The following parameters are used when configuring the job object limits for the host job object:

  • MemoryAllHosts
  • MemoryPerHost
  • ProcessLimitAllHosts
  • ThreadsPerHost

The host process polls handle usage and exits the process if the HandlesPerHost quota is violated. Changes to these values take effect after the computer is restarted.

Inheritance

Superclass chain

  1. __SystemClass
  2. __ProviderHostQuotaConfiguration

Known subclasses

No known subclass.

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.