Win32_WMISetting

Win32 WMISetting
root/cimv2dynamicsingleton

The Win32_WMISetting singleton WMI class contains the operational parameters for the WMI service. This class can only have one instance, which always exists for each Windows system and cannot be deleted. Additional instances cannot be created.

On this page

Main example

List instances

# All instances of Win32_WMISetting, with the main properties
Get-CimInstance -ClassName Win32_WMISetting |
    Select-Object -Property @(
        'Caption'
        'Description'
        'ASPScriptDefaultNamespace'
        'ASPScriptEnabled'
    )

Singleton class: only one instance exists.

Examples

Filter with WQL

# WQL filter evaluated by the provider: AutoStartWin9X = 0 (Don't start)
Get-CimInstance -ClassName Win32_WMISetting -Filter 'AutoStartWin9X = 0' |
    Select-Object -Property @(
        'Caption'
        'Description'
        'ASPScriptDefaultNamespace'
        'ASPScriptEnabled'
    )

The filter is evaluated by the WMI provider: less data is transferred than with Where-Object.

Decode numeric values

# Lookup table for AutoStartWin9X (values documented by Microsoft)
$autoStartWin9XName = @{
    0 = 'Don''t start'
    1 = 'Autostart'
    2 = 'Start on reboot'
}
# Lookup table for LoggingLevel (values documented by Microsoft)
$loggingLevelName = @{
    0 = 'Off'
    1 = 'Error logging'
    2 = 'Verbose Error logging'
}

Get-CimInstance -ClassName Win32_WMISetting |
    Select-Object -Property @(
        'Caption'
        'Description'
        'ASPScriptDefaultNamespace'
        'ASPScriptEnabled'
        @{ Name = 'AutoStartWin9X'; Expression = { $autoStartWin9XName[[int]$_.AutoStartWin9X] } }
        @{ Name = 'LoggingLevel'; Expression = { $loggingLevelName[[int]$_.LoggingLevel] } }
    )

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 {
    Get-CimInstance -CimSession $cimSession -ClassName Win32_WMISetting |
        Select-Object -Property @(
            'Caption'
            'Description'
            'ASPScriptDefaultNamespace'
            'ASPScriptEnabled'
        )
} 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_WMISetting
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

27 of 27 properties
NameTypeAccessDescription
ASPScriptDefaultNamespacestringread/write

Default script namespace. This property contains the namespace used by calls from the Scripting API for WMI if none is specified by the caller.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM\ scripting|Default Namespace

Example: root\cimv2

For an example script that uses this property, see the Remarks section.

Code
# Value of ASPScriptDefaultNamespace for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, ASPScriptDefaultNamespace |
    Select-Object -Property Caption, ASPScriptDefaultNamespace

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

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

If True, WMI scripting can be used on Active Server Pages (ASP). This property is valid on systems running unsupported versions of Windows only. For supported Windows systems, WMI scripting is always allowed on ASP.

Code
# Value of ASPScriptEnabled for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, ASPScriptEnabled |
    Select-Object -Property Caption, ASPScriptEnabled

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

# Warning: changes ASPScriptEnabled on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_WMISetting |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ ASPScriptEnabled = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
AutorecoverMofsstring[]read

List of fully qualified MOF file names used to initialize or recover the WMI repository. The list determines the order in which MOF files are compiled.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM\ CIMOM|Autorecover MOFs

Code
# Value of AutorecoverMofs for each instance
# AutorecoverMofs is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName Win32_WMISetting -Property AutorecoverMofs |
    Select-Object -ExpandProperty AutorecoverMofs
AutoStartWin9Xuint32read/write

Not supported.

Values (3)
ValueLabelDescription
0Don't start
1Autostart
2Start on reboot
Code
# Value of AutoStartWin9X for each instance
# Lookup table for AutoStartWin9X (values documented by Microsoft)
$autoStartWin9XName = @{
    0 = 'Don''t start'
    1 = 'Autostart'
    2 = 'Start on reboot'
}
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, AutoStartWin9X |
    Select-Object -Property @(
        'Caption'
        @{ Name = 'AutoStartWin9X'; Expression = { $autoStartWin9XName[[int]$_.AutoStartWin9X] } }
    )

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

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

Not supported. Instead, backup the WMI repository manually.

Unit: minutes

Code
# Value of BackupInterval for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, BackupInterval |
    Select-Object -Property Caption, BackupInterval

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

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

Date and time the last backup was performed.

Code
# Value of BackupLastTime for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, BackupLastTime |
    Select-Object -Property Caption, BackupLastTime

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

# Warning: changes BackupLastTime on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_WMISetting |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ BackupLastTime = (Get-Date) }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
BuildVersionstringread

Version information for the currently installed WMI service.

Length of time that elapses between backups of the WMI database.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM|Build

Code
# Value of BuildVersion for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, BuildVersion |
    Select-Object -Property Caption, BuildVersion
Captionstringread

Short textual description of the current object.

Code
# Value of Caption for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption |
    Select-Object -Property Caption
DatabaseDirectorystringread

Directory path that contains the WMI repository.

Code
# Value of DatabaseDirectory for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, DatabaseDirectory |
    Select-Object -Property Caption, DatabaseDirectory
DatabaseMaxSizeuint32read

Maximum size of the WMI repository.

Unit: kilobytes

Code
# Value of DatabaseMaxSize for each instance
# DatabaseMaxSize is expressed in kilobytes: converted to GB
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, DatabaseMaxSize |
    Select-Object -Property @(
        'Caption'
        @{ Name = 'DatabaseMaxSizeGB'; Expression = { [math]::Round($_.DatabaseMaxSize / 1MB, 2) } }
    )
Descriptionstringread

Textual description of the current object.

Code
# Value of Description for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, Description |
    Select-Object -Property Caption, Description
EnableAnonWin9xConnectionsbooleanread/write

Not supported.

Code
# Value of EnableAnonWin9xConnections for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, EnableAnonWin9xConnections |
    Select-Object -Property Caption, EnableAnonWin9xConnections

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

# Warning: changes EnableAnonWin9xConnections on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_WMISetting |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ EnableAnonWin9xConnections = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
EnableEventsbooleanread/write

If True, the WMI event subsystem should be enabled.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM|CIMOM|EnableEvents

Code
# Value of EnableEvents for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, EnableEvents |
    Select-Object -Property Caption, EnableEvents

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

# Warning: changes EnableEvents on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_WMISetting |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ EnableEvents = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
EnableStartupHeapPreallocationbooleanread/write

If True, WMI creates a pre-allocated heap with the size of the LastStartupHeapPreallocation value when WMI is initialized.

Code
# Value of EnableStartupHeapPreallocation for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, EnableStartupHeapPreallocation |
    Select-Object -Property Caption, EnableStartupHeapPreallocation

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

# Warning: changes EnableStartupHeapPreallocation on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName Win32_WMISetting |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ EnableStartupHeapPreallocation = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
HighThresholdOnClientObjectsuint32read/write

Maximum rate at which provider-created objects can be delivered to clients. To accommodate speed differentials between providers and clients, WMI holds objects in queues before delivering them to consumers. For more efficiency, consumers must collect the objects at a pace that matches the provider. If the memory held by uncollected objects reaches LowThresholdOnObjects, then WMI slows down the addition of new objects into the queue. If uncollected events continue to accumulate and the maximum wait to deliver events in MaxWaitOnClientObjects is reached while the memory used is at the value in HighThresholdOnClientObjects, then WMI accepts no more objects from providers and returns WBEM_E_OUT_OF_MEMORY to the clients.

Unit: objects per second

Code
# Value of HighThresholdOnClientObjects for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, HighThresholdOnClientObjects |
    Select-Object -Property Caption, HighThresholdOnClientObjects

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

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

Maximum rate at which events are to be delivered to clients. To accommodate speed differentials between providers and clients, WMI queues events before delivering them to consumers. For more efficiency, consumers must collect the events at a pace that matches the provider. If the memory held by uncollected events reaches LowThresholdOnObjects, then WMI slows down the addition of new events into the queue. If uncollected events continue to accumulate and the maximum wait to deliver events in MaxWaitOnEvents is reached while the memory used is at the value in HighThresholdOnEvents, WMI accepts no more events from providers and returns WBEM_E_OUT_OF_MEMORY to the clients.

Note: Throttling is only done for Permanent Event consumers, so temporary consumers should not expect throttling when events get backed up in the WMI internal event queue.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM\ CIMOM|High Threshold On Client Objects (B)

Unit: events per second

Code
# Value of HighThresholdOnEvents for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, HighThresholdOnEvents |
    Select-Object -Property Caption, HighThresholdOnEvents

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

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

Directory path where the WMI software has been installed. The default location is \System32\Wbem.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM|Installation Directory

Code
# Value of InstallationDirectory for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, InstallationDirectory |
    Select-Object -Property Caption, InstallationDirectory
LastStartupHeapPreallocationuint32read

Size of the pre-allocated heap created by WMI during initialization.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM|CIMOM|LastStartupHeapPreallocation

Unit: bytes

Code
# Value of LastStartupHeapPreallocation for each instance
# LastStartupHeapPreallocation is expressed in bytes: converted to GB
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, LastStartupHeapPreallocation |
    Select-Object -Property @(
        'Caption'
        @{ Name = 'LastStartupHeapPreallocationGB'; Expression = { [math]::Round($_.LastStartupHeapPreallocation / 1GB, 2) } }
    )
LoggingDirectorystringread/write

Directory path that contains the location of the WMI system log files.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM|CIMOM|Logging Directory

Code
# Value of LoggingDirectory for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, LoggingDirectory |
    Select-Object -Property Caption, LoggingDirectory

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

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

Enabling of event logging and the verbosity level of logging used.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM|CIMOM|Logging

Values (3)
ValueLabelDescription
0Off
1Error logging
2Verbose Error logging
Code
# Value of LoggingLevel for each instance
# Lookup table for LoggingLevel (values documented by Microsoft)
$loggingLevelName = @{
    0 = 'Off'
    1 = 'Error logging'
    2 = 'Verbose Error logging'
}
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, LoggingLevel |
    Select-Object -Property @(
        'Caption'
        @{ Name = 'LoggingLevel'; Expression = { $loggingLevelName[[int]$_.LoggingLevel] } }
    )

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

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

Rate at which WMI starts to slow the creation of new objects created for clients. To accommodate speed differentials between providers and clients, WMI holds objects in queues before delivering them to consumers. For more efficiency, consumers must collect the objects at a pace that matches the provider. If the rate of requests for objects reaches LowThresholdOnClientObjects, then WMI gradually slows down the creation of new objects to match the client's rate of use. This slowdown starts when the rate at which objects are being created exceeds the value of this property. See HighThresholdOnClientObjects.

This property reflects the registry value.

KEY_LOCAL_MACHINE\Software\Microsoft\WBEM\ CIMOM|High Threshold On Client Objects (B)

Unit: objects per second

Code
# Value of LowThresholdOnClientObjects for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, LowThresholdOnClientObjects |
    Select-Object -Property Caption, LowThresholdOnClientObjects

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

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

Rate at which WMI starts to slow the delivery of new events. To accommodate speed differentials between providers and clients, WMI queues events before delivering them to consumers. For more efficiency, consumers must collect the objects at a pace that matches the provider. If the queue grows out of control, WMI throttles—slows down—the delivery of events gradually to align with the client rate. This slowdown starts when the rate at which events are generated exceeds the value of this property. See HighThresholdOnEvents.

Note: Throttling is only done for permanent event consumers, so temporary consumers should not expect throttling when events get backed up in the WMI internal event queue.

This property reflects the registry value.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM\ CIMOM|High Threshold On Client Objects {B}

Unit: events per second

Code
# Value of LowThresholdOnEvents for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, LowThresholdOnEvents |
    Select-Object -Property Caption, LowThresholdOnEvents

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

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

Maximum size of the log files produced by the WMI service.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM|CIMOM|Log File Max Size

Unit: bytes

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

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

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

Amount of time a newly created object waits to be used by the client before it is discarded and an error value is returned. This property interacts with the LowThresholdOnClientObjects and HighThresholdOnClientObjects properties to throttle—slow down—the delivery of objects to consumers when the consumer is receiving the objects too slowly.

Unit: milliseconds

Code
# Value of MaxWaitOnClientObjects for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, MaxWaitOnClientObjects |
    Select-Object -Property Caption, MaxWaitOnClientObjects

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

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

Amount of time for which an event sent to a client is queued before being discarded. This property interacts0 with LowThresholdOnEvents and HighThresholdOnEvents to throttle—slow down—the delivery of objects to consumers when the consumer is receiving the objects too slowly.

This property reflects the registry value.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM\ CIMOM|Max Wait On Events (ms)

Unit: milliseconds

Code
# Value of MaxWaitOnEvents for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, MaxWaitOnEvents |
    Select-Object -Property Caption, MaxWaitOnEvents

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

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

Directory path for applications that install MOF files to the WMI repository. WMI automatically compiles any MOF files placed in this directory and, depending on its success, moves the MOF to a subdirectory labeled good or bad. If the # pragma autorecover command is included, the fully qualified file name is added to the AutorecoverMofs list used when WMI is initializing or recovering the repository. The list determines the order in which MOFs are compiled.

This property reflects the value in the registry key.

HKEY_LOCAL_MACHINE\Software\Microsoft\WBEM|CIMOM|MOF Self=Install Directory

Code
# Value of MofSelfInstallDirectory for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, MofSelfInstallDirectory |
    Select-Object -Property Caption, MofSelfInstallDirectory
SettingIDstringread

Identifier by which the current object is known.

Code
# Value of SettingID for each instance
Get-CimInstance -ClassName Win32_WMISetting -Property Caption, SettingID |
    Select-Object -Property Caption, SettingID

Remarks

The Win32_WMISetting class is derived from CIM_Setting. Only one instance of this class can exist on a computer.

Knowing how WMI is configured on a computer can be very useful when you are debugging scripts or troubleshooting problems with the WMI service itself. For example, many WMI scripts are written under the assumption that root\cimv2 is the default namespace on the target computer. As a result, script writers who need to access a class in "Root\CIMv2" often fail to include the namespace in the GetObject moniker, as shown in the following code sample:

Set colServices = GetObject("winmgmts:").ExecQuery ("SELECT * FROM Win32_Service")

If root\cimv2 is not the default namespace on the target computer, this script will fail. To prevent this from happening, the namespace root\cimv2 must be included in the moniker, as shown in the following code sample:

Set colServices = GetObject("winmgmts:root\cimv2").ExecQuery("SELECT * FROM Win32_Service")

If the default namespace on the target computer is different from the namespace assumed by a script, the script will fail. On top of that, the user will be presented with the somewhat misleading error message "Invalid class." In truth, the failure is not because the class is invalid but because the class cannot be found in the default namespace. This is a difficult problem to troubleshoot, because you are likely to investigate possible problems with the class rather than problems with the namespace that was (or, in this case, was not) specified.

You can use the Win32_WMISetting class to determine how WMI has been configured on a computer. Configuration details such as the default namespace or the WMI build number can be useful in troubleshooting script problems. These settings also provide important administrative information such as how, or even whether, WMI errors are logged on a computer and which WMI providers will automatically be reloaded if you need to rebuild the WMI repository.

Inheritance

Superclass chain

  1. CIM_Setting
  2. Win32_WMISetting

Known subclasses

No known subclass.

Requirements

Namespace
root/cimv2
Minimum client
Windows Vista
Minimum server
Windows Server 2008
Provider
WBEMCORE
MOF file
CIMWin32.mof
DLL
Wbemcore.dll
Class qualifiers

Singleton Dynamic Provider("WBEMCORE") UUID("{A83EF166-CA8D-11d2-B33D-00104BCC4B4A}") AMENDMENT

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.