Export (0) Print
Expand All

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

[Provider("WBEMCore")]class Win32_WMISetting : CIM_Setting
{
  string   ASPScriptDefaultNamespace;
  boolean  ASPScriptEnabled;
  string[] AutorecoverMofs;
  uint32   AutoStartWin9X;
  uint32   BackupInterval;
  datetime BackupLastTime;
  string   BuildVersion;
  string   Caption;
  string   DatabaseDirectory;
  uint32   DatabaseMaxSize;
  string   Description;
  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;
  string   SettingID;
};

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

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

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[]
Access type: Read-only

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

Not supported.

ValueMeaning
0

Don't start

1

Autostart

2

Start on reboot

 

BackupInterval
Data type: uint32
Access type: Read/write
Qualifiers: Units (Minutes)

Not supported. Instead, backup the WMI repository manually.

BackupLastTime
Data type: datetime
Access type: Read/write

Date and time the last backup was performed.

BuildVersion
Data type: string
Access type: Read-only

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

Short textual description of the CIM_Setting object.

DatabaseDirectory
Data type: string
Access type: Read-only

Directory path that contains the WMI repository.

DatabaseMaxSize
Data type: uint32
Access type: Read-only
Qualifiers: Units (Kilobytes)

Maximum size of the WMI repository.

Description
Data type: string
Access type: Read-only

Description of the CIM_Setting object.

EnableAnonWin9xConnections
Data type: boolean
Access type: Read/write

Not supported.

EnableEvents
Data type: boolean
Access type: Read/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

EnableStartupHeapPreallocation
Data type: boolean
Access type: Read/write

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: Units (Bytes)

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: 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

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: 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

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

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

ValueMeaning
0

Off

1

Error logging

2

Verbose Error logging

 

LowThresholdOnClientObjects
Data type: uint32
Access type: Read/write
Qualifiers: 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: 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: 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: 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: Units (Milliseconds)

Amount of time for which an event sent to a client is queued before being discarded. This property interacts 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

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

Identifier by which the CIM_Setting object is known.

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 Modify WMI Settings VBScript code example on the TechNet Gallery uses the Win32_WMISetting class to configure the WMI backup interval and logging level.

The List the Default Namespace VBScript code example on the TechNet Gallery uses the Win32_WMISetting class to retrieve and display the current WMI "Default namespace for scripting" setting.

The Modify the Default WMI Namespace VBScript code example on the TechNet Gallery uses the ASPScriptDefaultNamespace property to set the WMI "Default namespace for scripting" setting to "root\cimv2".

The List All the WMI Settings VBSCript code example uses a number of properties on Win32_WMISetting to return a list of WMI settings configured on a computer.

The List WMI Setting Information JavaScript code example uses a number of properties on Win32_WMISetting to return a list of WMI settings configured on a computer.

The List WMI Setting Information Python code example uses a number of properties on Win32_WMISetting to return a list of WMI settings configured on a computer.

The List WMI Setting Information Object REXX code example uses a number of properties on Win32_WMISetting to return a list of WMI settings configured on a computer.

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

CIMWin32.mof

DLL

Wbemcore.dll

See also

WMI Service Management Classes

 

 

Show:
© 2014 Microsoft