Win32_WMISetting class

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.

The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties. Properties and methods are in alphabetic order, not MOF order.

Syntax

[Singleton, Dynamic, Provider("WBEMCORE"), UUID("{A83EF166-CA8D-11d2-B33D-00104BCC4B4A}"), AMENDMENT]
class Win32_WMISetting : CIM_Setting
{
  string   Caption;
  string   Description;
  string   SettingID;
  string   ASPScriptDefaultNamespace = "\\\\root\\cimv2";
  boolean  ASPScriptEnabled;
  string   AutorecoverMofs[];
  uint32   AutoStartWin9X;
  uint32   BackupInterval;
  datetime BackupLastTime;
  string   BuildVersion;
  string   DatabaseDirectory;
  uint32   DatabaseMaxSize;
  boolean  EnableAnonWin9xConnections;
  boolean  EnableEvents;
  boolean  EnableStartupHeapPreallocation;
  uint32   HighThresholdOnClientObjects;
  uint32   HighThresholdOnEvents;
  string   InstallationDirectory;
  uint32   LastStartupHeapPreallocation;
  string   LoggingDirectory;
  uint32   LoggingLevel;
  uint32   LowThresholdOnClientObjects;
  uint32   LowThresholdOnEvents;
  uint32   MaxLogFileSize;
  uint32   MaxWaitOnClientObjects;
  uint32   MaxWaitOnEvents;
  string   MofSelfInstallDirectory;
};

Members

The Win32_WMISetting class has these types of members:

Properties

The Win32_WMISetting class has these properties.

ASPScriptDefaultNamespace

Data type: string

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\scripting|Default Namespace")

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.

ASPScriptEnabled

Data type: boolean

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\scripting|Enable for ASP")

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.

AutorecoverMofs

Data type: string array

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Autorecover MOFs")

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

AutoStartWin9X

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|AutostartWin9X")

Not supported.

Don't start (0)

Autostart (1)

Start on reboot (2)

BackupInterval

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Backup Interval Threshold"), Units ("minutes")

Not supported. Instead, backup the WMI repository manually.

BackupLastTime

Data type: datetime

Access type: Read/write

Qualifiers: MappingStrings ("Win32API|Time Functions|GetTimeZoneInformation")

Date and time the last backup was performed.

BuildVersion

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM|Build")

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

Caption

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64)

Short textual description of the current object.

This property is inherited from CIM_Setting.

DatabaseDirectory

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Repository Directory")

Directory path that contains the WMI repository.

DatabaseMaxSize

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Max DB Size"), Units ("kilobytes")

Maximum size of the WMI repository.

Description

Data type: string

Access type: Read-only

Textual description of the current object.

This property is inherited from CIM_Setting.

EnableAnonWin9xConnections

Data type: boolean

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|EnableAnonConnections")

Not supported.

EnableEvents

Data type: boolean

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|EnableEvents")

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

EnableStartupHeapPreallocation

Data type: boolean

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|EnableStartupHeapPreallocation")

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

HighThresholdOnClientObjects

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|High Threshold On Client Objects"), Units ("objects per second")

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.

HighThresholdOnEvents

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|High Threshold On Events"), Units ("events per second")

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)

InstallationDirectory

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM|Installation Directory")

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

LastStartupHeapPreallocation

Data type: uint32

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|LastStartupHeapPreallocation"), Units ("bytes")

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

LoggingDirectory

Data type: string

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Logging Directory")

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

LoggingLevel

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Logging")

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

Off (0)

Error logging (1)

Verbose Error logging (2)

LowThresholdOnClientObjects

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Low Threshold On Client Objects"), Units ("objects per second")

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)

LowThresholdOnEvents

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Low Threshold On Events"), Units ("events per second")

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}

MaxLogFileSize

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Log File Max Size"), Units ("bytes")

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

MaxWaitOnClientObjects

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Max Wait On Events"), Units ("milliseconds")

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.

MaxWaitOnEvents

Data type: uint32

Access type: Read/write

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM\\CIMOM|Max Wait On Events"), Units ("milliseconds")

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)

MofSelfInstallDirectory

Data type: string

Access type: Read-only

Qualifiers: MappingStrings ("Win32Registry|Software\\Microsoft\\WBEM|MOF Self-Install Directory")

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

SettingID

Data type: string

Access type: Read-only

Qualifiers: MaxLen (256)

Identifier by which the current object is known.

This property is inherited from CIM_Setting.

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.

Examples

The following VBScript code example shows how to obtain the version of WMI running on the local computer. The "Win32_WMISetting=@" indicates the single instance of the class. For more information, see WMI versions.

set objWMIService = GetObject("winmgmts:{impersonationLevel=Impersonate}!/Root/CIMv2")

set objWMISetting = objWMIService.Get("Win32_WMISetting=@")

WScript.Echo  objWMISetting.BuildVersion

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMV2
MOF
CIMWin32.mof
DLL
Wbemcore.dll

See also

CIM_Setting

WMI Service Management Classes