Windows Management Instrumentation Tester

Using Windows Management Instrumentation (WMI) Tester, also called WBEMTest, you can view and change Common Information Model (CIM) classes, instances, and methods. You can also use WBEMTest to troubleshoot Windows Management Instrumentation (WMI) and programs that depends on WMI.

  • For help with specific tasks, see How to.
  • For general background information, see Concepts.


How to...

  • Display WMI tester dialog box
  • Connect to WMI
  • Add or edit a property
  • Enumerate Classes
  • Create a class
  • Open classes
  • Delete a class
  • Enumerate instances of a class
  • Create an instance of a class
  • Open an instance
  • Delete an instance
  • Open a namespace
  • Execute a class and data query
  • Execute a notification query
  • Execute a Notification Query
  • Execute a method
  • Create a refresher


Display WMI tester dialog box

Microsoft Windows graphic

To display WMI tester dialog box

  1. Click Start, click Run, and then type wbemtest.exe.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.

Related Topics


Connect to WMI

Microsoft Windows graphic

To connect to WMI

  1. Click Start, click Run, and then type wbemtest.exe.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • The online help procedures use the root\cimv2 namespace. To step through the procedures, you must be connected to this namespace instead of the default namespace.
  • When you start WBEMTest, the Windows Management Instrumentation Tester dialog box appears. Before you can use WBEMTest functions, you must log on to WMI.

Related Topics


Add or edit a property

Microsoft Windows graphic

To add or edit a property

  1. Open the Property Editor dialog box by adding a property to a class or instance.
  2. Enter the name of a new property in the Property Name box. You cannot change the name of existing properties.
  3. Specify the data type of the data stored in the property. For example, if the property is to store string data, specify CIM_STRING.
  4. Select the Array check box if this property is to contain an array of objects of the type you declare.
  5. Select Not NULL, and then set a value for the property in the Value box. This value is the default value if this is a property of a class.
  6. Select standard qualifiers in the Qualifiers section by clicking the associated option button.
  7. Click Save Property to update this property.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Property Editor dialog box, click Start, click Run, and then type WBEMTest.exe. In the Windows Management Instrumentation Tester dialog box.
    • , click the desired IWbemServices button. In a dialog box containing a list of properties, double-click a property to display the Property Editor dialog box.
  • Use the Property Editor dialog box to create or edit properties of classes. In some cases, for example, when you edit an existing class, you might not be able to set all the properties on this dialog box.
  • The name of the parent class of the current class or instance is displayed in Class of origin. You cannot change the Class of origin property.
  • You can specify the standard qualifiers as a key property by clicking Key in the Qualifiers section. You can also add, delete, and edit other qualifiers by using Add Qualifier, Delete Qualifier, and Edit Qualifier.
  • The following table shows valid Common Information Model (CIM) types you can select in the Type box.
    • CIM Type | Type of data stored
CIM_SINT8 | 8-bit signed integer
CIM_UINT8 | 8-bit unsigned integer
CIM_SINT16 | 16-bit signed integer
CIM_UINT16 | 16-bit unsigned integer
CIM_SINT32 | 32-bit signed integer
CIM_UINT32 | 32-bit unsigned integer
CIM_SINT64 | 64-bit signed integer
CIM_UINT64 | 64-bit unsigned integer
CIM_REAL32 | 32-bit real number
CIM_REAL64 | 64-bit real number
CIM_BOOLEAN | BOOLEAN value
CIM_STRING | String
CIM_DATETIME | Date and Time
CIM_REFERENCE | Reference object
CIM_CHAR16 | Character
CIM_OBJECT | CIM object

Related Topics


Enumerate Classes

Microsoft Windows graphic

To enumerate classes

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Enum Classes.
  6. In the Superclass Info dialog box, type the name of the superclass to enumerate the child classes of a specific class.
    • Select Immediate only option if you want to see only the immediate subclasses of the superclass you specify.
    • Select Recursive option if you want to see all the classes of the superclass, subclasses of the superclass, and all the subclasses of those subclasses.
  7. To see all the top level classes for the current namespace, leave the Superclass Info dialog box empty and select Immediate only option.
  8. To see all the classes in a namespace, subclasses of the superclass, and all the subclasses of those subclasses, leave the Superclass Info dialog box empty and select Recursive option.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • You can display the child classes of a superclass by clicking Enum Classes in the Windows Management Instrumentation Tester dialog box.

Related Topics


Create a class

Microsoft Windows graphic

To create a class

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click the Create Class button.
    • If you are creating a new base class, leave the Optional Superclass dialog box empty.
    • If you are specifying an existing class definition, the new class is based on the current namespace.
    • For example, if you specify Win32_LogicalDisk as the superclass, the new child class inherits the properties of the Win32_LogicalDisk class.
  6. Click Continue.
  7. In the Object Editor dialog box, select the __Class property.
  8. Select Edit Property.
  9. In the Property Editor dialog box, click Not Null and then type the name for the new class in the text box.
  10. Click Save Property.
  11. In the Object Editor dialog box, define the properties, qualifiers, and methods for the new class.
  12. Click Save Object to create the new class.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • To use the Win32_LogicalDisk example above, you must be logged in to the root\cimv2 namespace.
  • You can create a new class definition in the current namespace by clicking Create Class in the Windows Management Instrumentation Tester dialog box.

Related Topics


Open classes

Microsoft Windows graphic

To open classes

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Open Class.
  6. In the Get Class Name dialog box, type the name of the class you want to open, and then click OK.
  7. Click Save Object in the Object Editor dialog box to save the changes to the class.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • You can edit properties, qualifiers, and methods for the class you specify with Open Class on the Windows Management Instrumentation Tester dialog box.

Related Topics


Delete a class

Microsoft Windows graphic

To delete a class

You can delete a class in the current namespace with Delete Class on the Windows Management Instrumentation Tester dialog box.

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Delete Class.
  6. In the Get Class Name dialog box, type the name of the class you want to delete, and then click OK.

    A dialog box is displayed to warn you that the class might have derived classes or instances. This dialog box is displayed even if there are no derived classes or instances.

  7. If you are sure you want to delete the class, click Yes to delete the class.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.

Related Topics


Enumerate instances of a class

Microsoft Windows graphic

To enumerate instances of a class

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Enum Instances.
  6. In the Class Info dialog box, type the name of the class for which you want to see instances.
    • To see instances of the derived classes of the superclass you specify, click recursive option.
    • To see only the immediate instances of the class you specify, click immediate option, and then click OK.
    • In the Query Result dialog box, the relative path for each of the instances is displayed.
  7. Double-click any of the instances listed in the Query Result dialog box to display the Object Editor dialog box for that instance.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • You can enumerate the instances of a class with Enum Instances on the Windows Management Instrumentation Tester dialog box.

Related Topics


Create an Instance of a class

Microsoft Windows graphic

To create an instance of a class

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click the Create Instance button.
  6. In the Create Instance dialog box, type the name of a class in the Enter class name: text box.
  7. Choose either Use IWbemclassObject::SpawnInstance to create a new instance from the current class or Use IWbemService::GetObject to retrieve an object from the namespace associated with the current IWbemServices object, and then click OK.
  8. Set the values of the properties for your new instance by clicking Edit Property on the Instance Of dialog box.
    • If the instance you are creating has key properties, set them to an appropriate value before you save the instance.
    • If you do not assign a value for the key property, a globally unique identifier (GUID) is assigned to the key property by default.
  9. Click Save Object to create the new instance.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • You can create a new instance of a class in the current namespace by clicking with the Create Instance button in the Windows Management Instrumentation Tester dialog box.

Related Topics


Open an Instance

Microsoft Windows graphic

To open an instance

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Open Instance.
  6. In the Get Object Path dialog box, type the relative object path for the instance you want to retrieve. And, then click OK to use the Object Editor dialog box to view or edit the class instance you have opened.

    Example?

    To open an instance of the Win32_LogicalDisk class, type:

    Win32_LogicalDisk.DeviceID="C:"

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • You can open an instance of a class with Open Instance on the Windows Management Instrumentation Tester dialog box.

Related Topics


Delete an instance

Microsoft Windows graphic

To delete an instance

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Delete Instance.

    The Get Object Path dialog box appears.

  6. Type the relative object path for the instance you want to delete.

    Example?

    To delete an instance of MyClass where the key property is F122, type:

    MyClass.KeyProperty="F122"

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • You cannot delete dynamic instances of static classes unless the provider supports this capability. For example, if you attempt to delete an instance of Win32_Process, a "Provider Not Capable" message appears because the provider does not support the deletion of dynamic instances.
  • You can delete an instance of a class by clicking Delete Instance in the Windows Management Instrumentation Tester dialog box.

Related Topics


Open a namespace

Microsoft Windows graphic

To open a namespace

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Open Namespace.
  6. In the Object Path text box, type the name of a namespace that is contained within the current namespace, and then click OK.

    Example?

    If you are already logged on to the root namespace, type:

    cimv2

    If the logon is successful, the namespace field on the Windows Management Instrumentation Tester dialog box is updated to show the new active namespace.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • Open Namespace opens only those namespaces that are inside the current active namespace.
  • You cannot move to a namespace that is closer to the root namespace than the current namespace. For example, if your current active namespace is root\cimv2, you cannot use Open Namespace to move to the root namespace. You must log on to WMI again to connect to other namespaces.
  • You can open a namespace within the namespace to which you are currently logged on Open Namespace in the Windows Management Instrumentation Tester dialog box.

Related Topics


Execute a class and data query

Microsoft Windows graphic

To execute a class and data query

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Query.
  6. In the Enter Query box, type your query.

    Example?

    A query that checks for instances of Win32_Logicaldisk that have a device ID of "C:" or "D:" and have at least 560 MB of disk space available:

    SELECT * FROM Win32_LogicalDisk
    WHERE (Name = "C:" OR Name = "D:")
    AND FreeSpace > 560000000

  7. If you want to see only the class definition, select the Retrieve class prototype check box.
  8. Click Apply to execute the query.

    WBEMTest attempts to return class instances based on the criteria you specify.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • You can create data and schema queries with the query option. However, you cannot create event notification queries with the query option.
  • If you do not select the Retrieve class prototype check box, instances are returned unless you construct a schema query.
  • You can execute class (schema) and data queries with Query on the Windows Management Instrumentation Tester dialog box.

For more information on WBEMTest, see Querying with WQL (http://www.microsoft.com/).

Related Topics


Execute a Notification Query

Microsoft Windows graphic

To execute a notification query

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Notification Query.
  6. In the Enter Query box, type an event notification query.

    Example?

    An event query that notifies you when a log event occurs:

    SELECT * FROM __instancecreationevent
    WHERE TargetInstance ISA 'Win32_NTLogEvent'
    AND (TargetInstance.LogFile="Application"
    OR TargetInstance.LogFile="System")

  7. Click Apply.
    • The text Operation in Progress appear in the lower-right corner of the Query Result dialog box, indicating that WMI is processing your query. Because event notification queries are never complete, the Operation in Progress status message is displayed on the Query Result dialog box until you stop the query.
    • For event notification queries that are running semisynchronously, you must specify batch count and time-out values. These values determine how events are extracted from the enumerator.
    • If your event notification query is running asynchronously, events are displayed in the Query Result dialog box as the events are received.
    • If you want to view an event notification, double-click the event in the Query Result dialog box. The Instance Of dialog box appears.
    • To stop the query, click Close .

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • If you want your event notification query to run asynchronously, select the Execute asynchronously check box on the Windows Management Instrumentation Tester dialog box.
  • You can query for event notifications with Notification Query on the Windows Management Instrumentation Tester dialog box.

Related Topics


Execute a method

Microsoft Windows graphic

To execute a method

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Execute Method.

    6. Example?

    To execute a method applying to a specific instance, type the relative path to the specific instance of that class:

    \Win32_Process\Handle="0".

    Example?

    To execute a method applying to the class in general, type only the class name:

    \Win32_Process\Handle="0"

  6. In the Execute Method dialog box, select the name of the method you want to run.
  7. Click Edit In Parameters to set the input parameters for the Create method.
  8. Click the CommandLine property and click Edit Property.
  9. Select Not NULL option and type the name of the executable to open as a new process.
  10. Click Save Property when you are done setting up the in parameters.
  11. Click Save Object in the Object Editor dialog box.
  12. Click Execute in the Execute Method dialog box to run the method.
  13. Click Edit Out Parameters to see the out parameters of the Create method.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • WMI creates an instance of the __Parameter class that you can examine to see the result code of the method returned. If the method does not run properly, you can determine the error by examining the value of the ReturnValue property. Some methods return the data as values of properties of the __Parameter instance. The Create method returns the process ID of the new process in a property called ProcessId.
  • If the execute method is successful, a dialog box displays the message Method executed successfully.
  • Many classes do not have the CommandLine property.
  • You can execute the methods of classes or class instances with Execute Method on the Windows Management Instrumentation Tester dialog box.
  • When you click CommandLine property and then click Edit Property, WBEMTest creates an instance of the __Parameters class and opens the Object Editor dialog box for this object. The properties of the __Parameters object define the in parameters for the method.
  • Most methods require specific input parameters to run correctly. The properties that you need to set depend on the method you are executing. In the preceding example of the Create method for the Win32_Process class of the Win32 Provider, the method to be executed requires only that the CommandLine parameter be set to the name of the process to be created.

Related Topics


Create a refresher

Microsoft Windows graphic

To create a refresher

  1. Open the Windows Management Instrumentation Tester dialog box.
  2. In the Windows Management Instrumentation (WMI) Tester dialog box, click Connect.
  3. In the Namespace box, type the path to the namespace that you want to connect to.

    Example?

    To connect to the namespace where the Win32 provider classes reside, type:

    root\cimv2

  4. Click Connect.
  5. Click Create Refresher.
  6. In the Query Result - REFRESHER dialog box, click Add to add a new refresher.
  7. Type the name of the class or the path to the instance of which your refresher is part in the Object Path box.
  8. Click Add Enum to add an enumerator of all instances of Win32_PerfRawData_PerfProc_Process (all processes) on your system.
  9. Click Refresh to populate the refresher.
  10. Double-click the enumerator.

Notes

  • Performing this task on the local computer does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials.
  • Performing this task on a remote computer requires that you are a member of the Administrators group on the remote computer, or that you have been delegated the appropriate authority.
  • To open the Windows Management Instrumentation Tester dialog box, click Start, click Run, and then type WBEMTest.exe.
  • A refresher is a container that encapsulates objects and other refreshers that need to be refreshed. Refreshers allow providers to deliver information at a very high rate. Because refreshers are an in-process DLL to the client applications, or an in-process DLL to WMI in the case of remote providers, they can deliver management information more quickly than standard providers.
  • If your system has the Performance Counters Provider installed and you are logged on to the root\cimv2 namespace, you can create a refresher for the Win32_PerfRawData_PerfProc_Process class.
  • You can use Windows Management Instrumentation Tester dialog box to create a refresher for any object in XOX. The Performance Counter Provider is an example of a standard provider that supports refreshers. If your operating system is XOX, you probably already have this provider installed.
  • For more information, see System Registry Provider. (http://www.microsoft.com/)

Related Topics


Concepts

This section covers:

  • Windows Management Instrumentation Tester overview
  • Using WBEMTest user interface


Windows Management Instrumentation Tester overview

Windows Management Instrumentation (WMI) Tester, also called WBEMTest, is a general-purpose tool for viewing and modifying WMI classes, instances, and methods during the development of Windows Management Instrumentation (WMI) providers and WMI applications. You can also use WBEMTest to troubleshoot WMI and programs that depend on WMI.

Use WBEMTest to perform the following tasks:

  • Create, enumerate, and delete WMI classes and instances.
  • Execute methods.
  • Run queries.
  • Display the Managed Object Format (MOF) code for classes and instances.

Because WBEMTest acts as an interface to the COM API for WMI, you can also use WBEMTest to check queries, classes, and instances when developing WMI providers and WMI client applications.

The executable file for WBEMTest, Wbemtest.exe, is installed in the WBEM directory of your Windows system directory. On XOX systems, this is the %WINDIR%\system32\Wbem folder.

For information about using the command-line interface to WMI, see Windows Management Instrumentation Command-line.

For information about using the WMI Control to configure WMI settings and security on a remote or local computer, see WMI Control overview.

For information about WMI security, see Managing WMI Security.


Using WBEMTest user interface

Two dialog boxes make up the primary interface to Windows Management Instrumentation (WMI) Tester, also called WBEMTest, functions.
  • The Windows Management Instrumentation Tester dialog box provides access to all WBEMTest functions. For information on how to display this dialog box, see Display WMI tester dialog box.
  • The Connect dialog box enables you to log on to WMI and connect to a namespace.

For more information about other WBEMTest dialog boxes, see:

  • Connect dialog box
  • Object Editor dialog box
    • Object Editor - Qualifier, Property, and Method functions
    • Object Editor dialog box - other functions
  • Get Object Path dialog box
  • Get Class Name dialog box
  • Superclass Info dialog box
  • Query dialog box
  • Query Result Dialog Box
  • Class Info dialog box
  • Execute Method dialog box
  • Property Editor dialog box
  • Qualifier Editor dialog box
  • Method Editor dialog box
  • Query Result dialog box for refresher
  • Get Object For Refresher dialog box
  • MOF dialog box

For information about WMI security, see Managing WMI Security.


Connect dialog box

Before you can use the functions of WBEMTest, you must log on to WMI. Click Connect on the Windows Management Instrumentation Tester dialog box to log on to WMI. The Connect dialog box appears.

Typically, you can accept the default settings displayed in the Connect dialog box, described as follows.

  • The Namespace boxes displays the default namespace for your computer. You can specify a different namespace on your computer or on another computer. For example, for access to the classes of the Win32 provider, you can specify root\cimv2. To access the cimv2 namespace on a remote computer named myserver, you can specify \\myserver\root\cimv2. To access remote computers, you must grant permission to read or write from the remote computer using the WMI Control application, Wbemcntl.exe.
  • The Connection: boxes specify properties of the connection to WMI. The Using: box specifies that IWbemLocator is used for obtaining the initial namespace pointer to Windows Management on a particular host computer. The Returning: box specifies that a IWbemServices pointer is used for accessing Windows Management information. The Completion box specifies that processing is synchronous.
  • The Credentials boxes enable you to specify a user name, password, and authority. You can log on to WMI using credentials different from those of the user who is currently logged on. If you leave these boxes blank, WMI uses the settings of the current Windows logged on user.
  • The Locale box enables you to specify a different locale by entering a localization code. To use the current locale, leave this box blank. Otherwise, it it must contain the location from which you want information. For Microsoft locale identifiers, the format of the string is "MS_xxx", where xxx is a string in hexadecimal form that indicates the Locale Identifier (LCID). For example, American English would appear as "MS_409".
  • The How to interpret empty password option buttons control what happens if you leave the password box blank. WMI processes a blank password differently from no password at all. The default value for this box is NULL and causes WBEMTest to use the current Windows logged on user password to connect to WMI. To log on to WMI using an empty password, select the Blank option button.
  • The Impersonation level option buttons enable you to set the Distributed COM (DCOM) impersonation level that WBEMTest typically uses. In most cases, you can use the default value, Impersonate,for this option button. However, some providers might require specific impersonation settings. Consult the documentation for the provider you are using if you are not sure which value to use. Additionally, the impersonation level that you specify must be applicable to the operating system you use. For example, if you specify an impersonation level of Delegate and WBEMTest is not running on a computer that uses the XOX or XOX operating system, this setting is ignored.

    For more information about impersonation, see Impersonation Level Enumeration. (http://www.microsoft.com/)

  • The Authentication level option buttons enable you to specify the Distributed COM (DCOM) authentication level you want to use. These authentication levels control how information is authenticated by DCOM. Typically, you can use Packet, the default value for this option button.

For more information on WBEMTest, see COM API for WMI (http://www.microsoft.com/). Also see the Windows Management Instrumentation documentation at the Microsoft Platform SDK Web site (http://www.microsoft.com/).


Object Editor dialog box

The Object Editor dialog box appears when you double-click a class or instance from the Query Result dialog box. The Object Editor dialog box also appears when you click Open Class or Enum Class on the Windows Management Instrumentation Tester dialog box.

You can use the Object Editor dialog box to:

  • Edit the qualifiers, properties, and methods for the selected class or instance.
  • View the MOF code that creates the class or instance.
  • View instances of the class, the derived classes, and the superclass of the class, if you are editing a class definition.
  • Refresh the view of the object after you make changes.

For example, when you click Open Class in the Windows Management Instrumentation Tester dialog box, and then type Win32_LogicalDisk in the Get Class Name dialog box, the Object Editor for Win32_LogicalDisk dialog box appears.

If you double-click any item in a list box, the appropriate editor opens for that object. For example, if you double-click the reset method in the methods list box, the method editor for the reset method appears.

For more information on WBEMTest, see COM API for WMI (http://www.microsoft.com/). Also see the Windows Management Instrumentation documentation at the Microsoft Platform SDK Web site (http://www.microsoft.com/).


Object Editor - Qualifier, Property, and Method functions

In the Object editor, you can do the following:

  • Open the Qualifier Editor dialog box by clicking Add Qualifier. You can use this feature to add qualifiers that apply to the class or instance as a whole as opposed to a specific property of the class or instance. Type in the values for the new qualifier and click Save Qualifier to create the new qualifier.
  • Open the Qualifier Editor dialog box for the qualifier that is selected, by clicking Edit Qualifier. You can use this to change the value or flavors assigned to a qualifier.
  • Delete the currently selected qualifier, by clicking Delete Qualifier.
  • Not display system properties in the Object Editor dialog box, by clicking Hide System Properties.
  • Define new properties and assign values to classes or instances, by clicking Add Property. When you click Add Property, the Property Editor dialog box appears.
  • Change the definition for the currently selected property, by clicking Edit Property.
  • Delete the currently selected property, by clicking Delete Property.
  • Define the methods for a class or instance, by clicking Add Method. When you click Add Method, the Method Editor dialog box appears.
  • Edit the methods for a class or instance, by clicking Edit method. When you click Edit Method, the Method Editor dialog box appears.
  • Delete the currently selected method, by clicking Delete Method.

For more information on WBEMTest, see COM API for WMI (http://www.microsoft.com/). Also see the Windows Management Instrumentation documentation at the Microsoft Platform SDK Web site (http://www.microsoft.com/).


Object Editor dialog box - other functions

In the Object Editor dialog box, you can do the following:

  • Close the Object Editor dialog box, by clicking Close.
  • Save the changes to the current class or instance, by clicking Save Object.
  • Open the MOF dialog box, which contains the managed object format (MOF) code that you can use to construct the current object, by clicking Show MOF. It is important to remember that the MOF code shown in this dialog box might not be identical to the actual MOF code that created the class or instance. The original MOF file might have comments and different formatting from text shown, for more information. see Managed Object Format (http://www.microsoft.com/)
  • Run a schema query that shows the class from which the current class or instance is derived, by clicking Superclass.
  • Run a schema query that shows the child classes of the current class or instance, by clicking Derived.
  • Show instances of the current class, by clicking Instances.
  • Control how the class are updated, by using the Update type option. The following tables describe the two groups of option buttons that control the update process.
Update Type | Meaning
Create only | Used for creation only. The save operation fails if the class or instance already exists.
Update only | Causes this call to update.
Either | Causes the class or instance to be created if it does not exist, or overwritten if it exists already.

Update Type | Meaning
Compatible | Allows a class to be updated are no derived classes and instances for that class exist. It also allows updates in all cases if qualifiers are changed, such as the description qualifier. This is the default value for this option and is used for compatibility with previous versions of WMI. If the class has instances, the update fails.
Safe | Allows updates of classes even when there are child classes, providing the change does not cause any conflicts with child classes. An example of an update to this value is adding to the base class a new property that was not previously mentioned in any of the child classes. If the class has instances, the update fails.
Force | Forces updates of classes when conflicting child classes exist. For example, this value forces an update if a class qualifier was defined in a child class, and the base class tries to add the same qualifier in conflict with the existing one. In force mode, this conflict is resolved by deleting the conflicting qualifier in the child class. If the class has instances, the update fails.

For more information on WBEMTest, see COM API for WMI (http://www.microsoft.com/). Also see the Windows Management Instrumentation documentation at the Microsoft Platform SDK Web site (http://www.microsoft.com/).


Get Object Path dialog box

Use the Get Object Path dialog box to specify the name of a class or the relative path to a class instance.

Object paths have the format: [Class].[KeyProperty] = Value

For example, an instance of a class called Myclass that has a key property called Keyproperty with a value of "A" the object path is: MyClass.KeyProperty="A".

For more information, see WMI Object Path Requirements. (http://www.microsoft.com/)


Get Class Name dialog box

Use the Get Class Name dialog box to specify class names for the WBEMTest Open Class function.


Superclass Info dialog box

The Enum Classes function uses the Superclass Info dialog box. If you select the Recursive option button, WBEMTest also enumerates all subclasses of the class you specify, instead of only the immediate subclasses of that class.


Query dialog box

Use the Query dialog box to compose a query, and then execute it. To display the Query dialog box, click Query on the Windows Management Instrumentation Tester dialog box.

In the Enter Query text box, type the WBEMTest query .

In the Query Type list box, you can select a query language. Currently, only Windows Management Instrumentation (WMI) Query Language (WQL) is supported.

You can use the Retrieve class prototype check box to indicate that you do not want instances from this query, and then to the class that the instances might belong to if returned.

For more information, see Querying WMI. (http://www.microsoft.com/)


Query Result dialog box

The Query Result dialog box is displayed when you perform a function that enumerates classes or instances. This dialog box also appears for event notification queries to display events. For asynchronous event notification queries, this dialog box displays the events as received. New events are delivered when you run a semisynchronous event notification query.

If the query results are instances, the relative path for the instances is displayed. You can double-click any of the objects in the Query Result dialog box to display the Object Editor dialog box for that object.

For more information, see Object Editor dialog box.


Class Info dialog box

Use the Class Info dialog box to specify the name of the class for which you want to see instances. This dialog box appears when you click Enum Instances on the Windows Management Instrumentation Tester dialog box. If you select Immediate Only, the default value, only instances of the class you specify are displayed. If you select Recursive, instances of the subclasses of the class you specify are displayed.

For more information on WBEMTest, see COM API for WMI (http://www.microsoft.com/). Also see the Windows Management Instrumentation documentation at the Microsoft Platform SDK Web site (http://www.microsoft.com/).


Execute Method dialog box

In the Execute Method dialog box, you can do the following:

  • Edit the object path, by clicking Edit Object Path and set the object path to refer to a specific instance if necessary.
  • Show the current object path in the Object Path text box.
  • Close this dialog box without executing the method, by clicking Dismiss.
  • Display the methods available for this class in the Method drop-down list .
  • Set the various parameters the method might require, by clicking Edit In Parameters.
  • Reset all the input parameters to the default settings, by clicking Clear In Parameters.
  • View the output parameters for the method, by clicking Edit Out Parameters. The output parameters contain data returned from a method.

Notes

  • To display the Execute Method dialog box, click Execute Method on the Windows Management Instrumentation Tester dialog box.
  • You can use the Execute Method dialog box to run a method of a class or class instance.


Property Editor dialog box

Use the Property Editor dialog box to create or edit properties of classes. In some cases, for example, when you edit an existing class, you might not be able to set all the fields on this dialog box.

For more information, see Add or edit a property. Also see the Windows Management Instrumentation documentation at the Microsoft Platform SDK Web site (http://www.microsoft.com/).


Qualifier Editor dialog box

You can define the name, data type, option, and value of a qualifier in the Qualifier Editor dialog box.

You can assign five common qualifier options to your qualifier by selecting the check boxes in the option section. The following options are available:

  • Propagates to instances
  • Propagates to derived classes
  • Allows overrides
  • Propagated
  • Amended

For more information, see WMI-Specific Qualifiers.


Method Editor dialog box

In the Method Editor dialog box, you can do the following:

  • Enable the Edit Input Arguments button by clicking the Enable Input Args option button.

    To open the Object Editor dialog box for an instance of the __Parameters class, click the Edit Input Arguments button. You can use the object editor to edit or define new input parameters for a method.

  • Enable the Edit Output Arguments button by clicking the Enable Output Args option button.

    To display the Object Editor dialog box for an instance of the __Parameters class, click the Edit Output Arguments button. You can use the object editor to edit or define new output parameters for a method.

  • Add, delete, and edit the qualifiers for this method in the Qualifiers section.
  • Save new methods and update existing methods by clicking Save Method.

Notes

  • To display the Method Editor dialog box, in the Windows Management Instrumentation Tester dialog box, click the appropriate IWbemServices class button. In the next dialog box, select a Method, and then click the appropriate Method button.
  • You can use the Method Editor dialog box to add methods to classes and class instances, and to edit methods.


Query Result dialog box for refresher

In the Query Result dialog box for refresher, you can do any of the following:

  • Display the Get Object For Refresher dialog box where you can add objects or enumerators to a refresher, by clicking Add. Type the name of a class that supports refreshers in the Object Path text box to add a refresher to the query.
  • Delete objects or enumerators from a refresher by clicking Delete.
  • Populate the instances with data, clicking Refresh.

Notes

  • To display the Query Result dialog box for refresher, on the Windows Management Instrumentation Tester dialog box, click Create Refresher.
  • The refreshers you create are empty until you click Refresh. Click Refresh as often as necessary to update the data in your refreshers.

For more information on WBEMTest, see COM API for WMI (http://www.microsoft.com/). Also see the Windows Management Instrumentation documentation at the Microsoft Platform SDK Web site (http://www.microsoft.com/).


Get Object For Refresher dialog box

In the Get Object For Refresher dialog box, you can do the following:

  • Refresh an object, by typing the relative path to an instance and then clicking Add Object.
  • Refresh an enumerator, by typing the class name of your refresher and then clicking Add Enum.

Notes

  • To display the Get Object For Refresher dialog box, click Add in the Query Result - REFRESHER dialog box.
  • To specify the object path to an instance you are adding to your refresher or to specify the Class name of the enumerator you want to add to your refresher, use the Get Object For Refresher dialog box.

For more information on WBEMTest, see COM API for WMI (http://www.microsoft.com/). Also see the Windows Management Instrumentation documentation at the Microsoft Platform SDK Web site (http://www.microsoft.com/).


MOF dialog box

The MOF dialog box appears when you click Show MOF on the Object Editor dialog box. You can use the MOF dialog box to display Managed Object Format (MOF) code when editing a class or class instance in the Object Editor dialog box.

For information, see Object Editor dialog box.