Main example
List instances
# All instances of ScriptingStandardConsumerSetting, with the main properties
Get-CimInstance -ClassName ScriptingStandardConsumerSetting -Namespace 'root/subscription' |
Select-Object -Property Caption, Description, MaximumScripts, SettingIDSingleton class: only one instance exists.
Examples
Filter with WQL
# WQL filter evaluated by the provider: names starting with "a" (the WQL wildcard is %)
$cimParameters = @{
ClassName = 'ScriptingStandardConsumerSetting'
Namespace = 'root/subscription'
Filter = "Caption LIKE 'a%'"
}
Get-CimInstance @cimParameters |
Select-Object -Property Caption, Description, MaximumScripts, SettingIDThe filter is evaluated by the WMI provider: less data is transferred than with Where-Object.
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 = 'ScriptingStandardConsumerSetting'
Namespace = 'root/subscription'
}
Get-CimInstance @cimParameters |
Select-Object -Property Caption, Description, MaximumScripts, SettingID
} 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 ScriptingStandardConsumerSetting -Namespace 'root/subscription'
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, FlagsProperties
| Name | Type | Access | Description |
|---|---|---|---|
| Caption# | string | read | A short description of an object a one line string. Contains the string ScriptingStandardConsumerSetting because this is a singleton class. Code |
| Description# | string | read | A text description of an object. Code |
| MaximumScripts# | uint32 | read/write | Maximum number of scripts that are run before a consumer starts a new instance. To clear out memory leaks from scripts, shut down the consumer regularly. The default value is 300. CodeWarning. Changes the system: check with -WhatIf first. An elevated console is often required. |
| SettingID# | string | read | Identifier for the setting object. Code |
| Timeout# | uint32 | read/write | Maximum number of minutes before a consumer starts a new instance. If 0 (zero), the MaximumScripts property controls the consumer lifetime. The valid range for Timeout is 0 through 71,000 and the default value is 0 (zero). Unit: Minutes CodeWarning. Changes the system: check with -WhatIf first. An elevated console is often required. |
Remarks
The single instance of the ScriptingStandardConsumerSetting class resides in the root\cimv2 namespace.
Inheritance
Superclass chain
- CIM_Setting
- ScriptingStandardConsumerSetting
Known subclasses
No known subclass.
Requirements
- Namespace
- root/subscription
- Minimum client
- Windows Vista
- Minimum server
- Windows Server 2008
- MOF file
- Scrcons.mof
- DLL
- Scrcons.exe
Class qualifiers
Singleton AMENDMENT
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.