WMI Tools

WMI Tools

The Windows Management Instrumentation (WMI) Tools include the following Windows Management Instrumentation (WMI) applications:

  • WMI Object Browser

    WMI Object Browser can be used to view objects in a Common Information Model (CIM) repository. You can also edit property values, edit object and property qualifiers, and run selected methods.

  • WMI CIM Studio

    WMI CIM Studio can be used to view classes in a CIM repository. You can also edit classes, properties, qualifiers, and instances; run selected methods; generate and compile Managed Object Format (MOF) files; and generate framework provider code.

  • WMI Event Registration Tool

    WMI Event Registration Tool is a graphical interface used to configure permanent event consumers. Using the tool, users can create or view instances of event consumers, filters, bindings, and timer system classes.

  • WMI Event Viewer

    WMI Event Viewer displays events for all instances of registered consumers. You can also start WMI Event Registration Tool from WMI Event Viewer.

This document provides a brief description of these applications and how to use them. For general application information, including logon instructions, see Using WMI Applications.

Built on Tuesday, July 09, 2002


Using WMI Applications

This section contains the following topics:

  • System Requirements for WMI Applications
  • WMI Application Logon


System Requirements for WMI Applications

To use WMI applications, your system must include the following hardware and software:

  • Microsoft® Windows® 2000 or later (for remote connections, Microsoft® Windows® 2000 SP2 or later)
  • Microsoft® Internet Explorer version 5.0 or later. You can download the latest version of Internet Explorer from http://www.microsoft.com/windows/ie.
  • Screen resolution of at least 800 X 600.


WMI Application Logon

When you start any WMI application, you will be presented with the Connect to namespace dialog box. The default namespace is that of the local computer (\root\CIMV2). To connect to another namespace on the local computer or on another computer on the network, either enter the path name or click Browse For Namespace ( [image]).

After you connect to a namespace, you must complete a logon dialog box. This dialog box may also appear at other times while you are using the WMI applications (when you connect to a namespace on a remote computer, for example). This dialog box is the same for all WMI applications, except that the name of the application that you are logging on to is displayed as the title of the dialog box.

To change either the impersonation level, the authentication level, authority, or to enable all privileges, click Options and expand the logon dialog box. You can choose new impersonation and authentication levels from the associated lists, or click enable all privileges to request all Windows NT/Windows 2000 privileges.

The enable all privileges check box allows you perform operations that require a specific Windows NT/Windows 2000 privilege. For example, the Win32_OperatingSystem method Win32Shutdown requires the privilege SeShutdownPrivilege.

Note Once the enable all privileges is checked it cannot be cleared until you restart the application. The enable all privileges check box only enables the Windows NT/Windows 2000 privileges that you have been granted. The operating system may only grant specific privileges depending on your security rights.

When you log on to a local namespace, the Login as current user check box is selected, and the Username, Password, and Authority boxes are unavailable. When you log on to a remote namespace, Username, Password, and Authority are available.

You can log on to your local computer as the current user. You can log on to a remote computer as either the current user or a different user. In either case, you must be an authorized WMI user.

The Authority box is used to specify NTLM or Kerberos authentication.

  • If the text you enter in Authority begins with the string "kerberos:", Kerberos authentication will be used and the text in Authority should contain a Kerberos principal name. For example, Kerberos:<principal name>.
  • If the text you enter in Authority contains any other value, or begins with the string "NTLMDOMAIN:", NTLM authentication will be used and text in Authority should contain a NTLM domain name. For example, NTLMDOMAIN:<domain name>.
  • If you leave this box empty when connecting to a remote system, the operating system will negotiate with DCOM to determine whether NTLM or Kerberos authentication will be used

To complete a WMI logon dialog box

  1. If you are logging in as the current user on the local computer, click OK.
  2. If you are logging in on a remote computer do one of the following.
    1. If you have the proper permissions on the remote computer, you may login as the current user by clicking OK.
    2. If you do not have the proper permissions on the remote computer or you want to login as a different user, click to clear Login as current user and enter your information in Username and Password. The user name can be in the form domain\user. Click OK.

By default, all members of the local users group on Windows NT/Windows 2000 systems have read-only access to all namespaces. To change the default access permissions from Windows NT, use the WMI Control application (Wbemcntl.exe). To change the default access permissions from Windows 2000, use the Microsoft® Management Console.


WMI Object Browser

WMI Object Browser is an application designed for use by system managers. Using this application, you can display the object tree for a Common Information Model (CIM) repository, view object details (properties, methods, qualifiers, and associations), edit some object information, and run selected methods. For more information, see the following topics:

  • Starting WMI Object Browser
  • WMI Object Browser User Interface
  • WMI Object Browser Functions


Starting WMI Object Browser

To start WMI Object Browser

  1. On the Start menu, point to Programs, and then click WMI Tools.
  2. Click WMI Object Browser.
  3. In the Connect to namespace dialog box, enter a namespace and click OK. For more information about logging in to a namespace, see WMI Application Logon.

    After logging in, if you have previously accessed the selected namespace in WMI Object Browser, the object tree appears. If this is the first time you are accessing the namespace, you must select an initial object tree root.

  4. At the first access of the namespace, use the Select Initial Tree Root dialog box to browse classes and their instances and then choose an instance as the root of the object tree. This dialog box initially lists only the classes in the current namespace that can have instances.
  5. In the Select Initial Tree Root dialog box, select Show all classes to see all classes in the current namespace, or Show Associations to display association classes. Classes that cannot have instances (abstract classes) appear in bold type.
  6. For each class to browse, click the class name in the Available Classes list and then click Add>>.

    Each class added appears in the Browse for objects in box. (For quicker selection, you can start typing the class name in the Available Classes box to move directly to the class location in the list.) You can remove selected classes from the search by clicking the class name in the Browse for objects in box, and then clicking Remove.

  7. When you are done choosing classes, click OK.
  8. Click the instance to be the root and click OK.

    The object tree appears in WMI Object Browser with the selected instance as the root. Note that WMI Object Browser uses the selected root as the default root whenever you subsequently access the namespace. You can change this by using the Make Initial Tree Root function.

Note An instance of the Win32_ComputerSystem class is the default root for the Root\Cimv2 namespace.


WMI Object Browser User Interface

WMI Object Browser contains an Object Explorer and an Object Viewer. In general, you select objects in the Object Explorer, and their details appear in the Object Viewer. A sample WMI Object Browser screen is shown below.


Object Explorer

The left pane in the WMI Object Browser is the Object Explorer, which shows the object tree contained in the current namespace. By default, the Root\CIMV2 namespace on the local computer appears. You can select a different local namespace or a namespace on a remote computer.

The Object Explorer shows a hierarchy of the instances that are found in a certain namespace following association links. Since this tree really represents a graph, any instance in the namespace can be selected as the root of the tree. The root can be changed temporarily in a session (through re-rooting the tree) or permanently (through schema) so that the selected root persists among WMI Object Browser sessions.

The tree always starts with an instance in the selected namespace. When that instance is expanded, each node in the next level represents a different type of association that this instance participates in (or a different role in the same association). These nodes are labeled in the form <association.role>, where "association" is the association class, and "role" is the role that the associated object plays in this association class. Expanding the tree one additional level, the nodes represent either the actual instance that is associated to the original object (if there is only one instance of a particular class) or a group of all instances of a particular class that are associated to the original object. In the latter case, expansion of one more level shows the actual instances of that class that are associated to the original object. For any node that represents an instance, the same type of expansion applies again.

The tree shows regular objects and grouping nodes. Grouping nodes are not objects themselves but are a way to organize objects. The symbols next to the names indicate the type of object or node.

Symbol | Description
 | Regular object.
 | Node that groups objects by type (class).
 | Node that groups objects by association type (class) and role. All objects beneath this type of node are associated with the parent object through the same association type and role.

Some of these symbols are also used in the Object Viewer.

Hovering over an object in the tree displays the object's path. The object path identifies the object in the namespace. You can also change the root of the object tree. For instructions, see Rerooting an Object Tree.

The Object Explorer also includes the following buttons.

Button | Description
 | Browse for Namespace allows you to browse and select namespaces on the local computer or a remote computer. For information, see Browsing for a Namespace.
 | Browse for Instance allows you to browse classes for a specific instance and reroot the Object Explorer tree from that instance. For information, see Using Browse for Instance to Reroot the Object Tree.


Object Viewer

The right pane in WMI Object Browser is the Object Viewer, which displays details about a selected object. Using the tabs, you can display the properties, methods, and associations for an object. For additional information on each of these views, see WMI Object Browser Functions.

Selecting a regular object in the Object Explorer automatically updates the Object Viewer to show details about that object. Selecting a grouping node updates the Object Viewer to show an instances table for that node. This table represents all instances that are contained under the selected node. For example, for an association.role grouping node, the table will show all instances associated to the original object in the tree through this association type and in this role.

The top of the Object Viewer displays a title of the current view. For a single object, the title is the object path of the instance currently displayed. For a multiple-object table, the title describes the group of objects currently displayed.

The Object Viewer uses an additional symbol to identify association objects ( [image]) on the Associations tab.

The Object Viewer includes the following buttons.

Button | Description
 | Back/Forward displays previously-viewed tabs.
 | Save commits changed information to Windows Management.
 | Views switches to filtered or custom views of object data. See Filtering Views of Object Properties
 | Help for Class displays help information about the selected object class.
 | Help opens the WMI online documentation.


WMI Object Browser Functions

Using WMI Object Browser, you can do the following:

  • Display the object tree contained in a specified CIM repository.
  • Reroot the object tree.
  • Display properties, methods, and associations for a selected object.
  • Display instances of grouped objects.
  • Display property and object qualifiers.
  • Execute methods on a selected object.
  • Edit property values and object and property qualifiers.

Note If an error occurs while you are editing object properties or qualifiers (for example, if you enter a property type and value that are incompatible), a message box appears with a brief description of the problem. In some cases, Windows Management or the provider involved supply an error object with additional detailed information about the problem that occurred. Click Advanced to view the error object's properties. The property display contains more details about the problem that occurred.

Error objects are instances of the __ExtendedStatus class (or derivatives of this class).


Displaying an Object Tree

By default, WMI Object Browser sets the namespace to root\CIMV2, which is the default namespace on the local computer. You can view the object tree for any namespace in your system or on a network by specifying the namespace path in one of the following ways:

  • Specifying the namespace in the Objects in Box
  • Selecting the namespace from the history list
  • Browsing for a Namespace
  • Using the Go to Namespace function

Note While WMI Object Browser runs with any repository, a repository that has no associations shows only a single object, the root selected by the user. This type of repository can be viewed more effectively in WMI CIM Studio.


Specifying the Namespace in the Objects in Box

The format for specifying a namespace in the Objects in box is as follows:

[\\computer\]root\namespace

For example, specifying \\EDKDOCS5\root\CIMV2 displays the object tree for the CIMV2 namespace on the computer, EDKDOCS5. If no computer is specified, the default is the local computer. You can also specify a chain of namespaces, separating each with a backslash.

\\computer\root\namespace\namespace\namespace

The Objects in box also keeps a list of previously used namespaces. Click the arrow to choose a namespace from this history list.


Selecting the Namespace from the History List

The Objects in box keeps a list of previously selected namespaces. Click the arrow to select a namespace from this history list.


Browsing for a Namespace

To browse for a namespace

  1. Click Browse for Namespace.
  2. In the Browse for Namespace dialog box, Machine Name shows the local computer by default. To select a namespace on another computer, enter that computer name, proceeded by '\\', in the Machine Name box, and click Connect.

    —or—

    Click Network Neighborhood, select the remote computer from the list that appears, and then click OK.

    The first time a user connects the WMI Active X controls to a namespace, the WMI Login dialog box is presented. Upon successful logon, the connection is cached for future use. If the Browse for Namespace dialog box is used to re-open a namespace, any currently available connections will be re-used by default. To use a new set of credentials to connect to a namespace (such as a new username/password), clear the Use existing connection if possible check box. This results in the existing connection being closed and the WMI Login dialog box being presented when the namespace is selected. Completing this dialog box makes a connection to the requested computer and returns to the Browse for Namespace dialog box with an initialized tree of the existing namespace on that computer.

  3. In the Starting Namespace box, enter the complete path (starting at root) of the namespace to browse. Note that the last namespace in the path must be one you have access to. It is important that you know what namespaces you have access to, since you cannot discover them by browsing parent namespaces for which you do not have access.

    For example, given the set of namespaces root, root\private, and root\private\you, your access to root and root\private\you but not to root\private would prevent you from browsing downward from Root to root\private\you. You would have to enter root\private\you directly in Starting Namespace.

  4. Click the plus sign (+) next to any namespace to display the namespaces under it. If you do not have access to the namespace, it will not open to reveal the namespaces under it.
  5. Click the namespace to use and then click OK.

    This returns you to where you came from.

    If you entered the Browsing for a Namespace dialog box from Object Browser and a default root node is defined for this namespace, the object tree uses that for the initial root object. If not, the instance search tool is displayed to let the user select a root. See Using Browse for Instance to Reroot the Object Tree.

    If you entered Browsing for a Namespace from CIM Studio, the class tree is displayed for the selected namespace.


Using the Go to Namespace Function

The object tree can contain objects from other namespaces. If an object is from another namespace, the object's full path (including the computer name if it resides on a different computer) appears in the tree. You can display the tree for that object's namespace by using the Go to Namespace function.

To use the Go to Namespace function

Right-click the object whose namespace you want to display and click Go to Namespace. The object tree for the namespace appears rooted at the selected object.


Rerooting an Object Tree

In WMI Object Browser, when you connect to a namespace for the first time, you must set the initial tree root. The selected root is then used as the default whenever you subsequently access the namespace. You can reroot the object tree during an WMI Object Browser session, and you can also select a new initial root.

The default root that the Object Explorer uses for any given namespace is stored in the CIM repository in the schema. For every namespace accessed by WMI Object Browser, the NamespaceConfiguration class is defined, and an instance of it defines the current default root of the object tree.

Any regular object can be made the root of the object tree by using one of the following methods:

  • Using Make Initial Tree Root
  • Using Make Root to Reroot the Object Tree
  • Using Browse for Instance to Reroot the Object Tree


Using Make Initial Tree Root

To change the default initial object tree root

Right-click the object to be made the initial root and click Make Initial Tree Root. Because only regular objects can be made the root of the tree, Make Initial Tree Root is not available if grouping nodes are selected.

The new default object tree root takes effect the next time you connect to the namespace.


Using Make Root to Reroot the Object Tree

To change the root of the object tree

Right-click the object to be the new root and click Make Root. Because only regular objects can be made the root of the tree, Make Root is not available if grouping nodes are selected.

The following screens show how the tree display changes when different roots are selected.

Root = Win32_OperatingSystem Root = Win32_CDRomDrive


Using Browse for Instance to Reroot the Object Tree

You can reroot the object tree from a specific instance by using the Browse for Instance function. The Browse for Instance function allows you to display all objects in the selected classes. You can then select the object to be the new root of the object tree.

To browse for an instance

  1. In the Object Explorer, click Browse for Instance.
  2. In the Browse for Instance dialog box, select Show all classes to see all classes in the current namespace.

    By default, this dialog box shows the list of classes that can have instances. Classes that cannot have instances (abstract classes) appear in bold type.

  3. Select the Show Associations check box to display association classes.
  4. For each class to browse, click the class name in the Available Classes list and then click Add ->.

    Each class selected appears in the Browse for objects in box. (For quicker selection, you can start typing the class name in the Available Classes box to move directly to that class location in the list.)

    You can remove selected classes from the search by clicking the class name in the Browse for objects box and then clicking <- Remove.

  5. Click OK.
  6. In the Browse for Instance results, click the object to be the root of the object tree and then click OK to return to WMI Object Browser.

    The object tree appears with the selected object as the new root.


Displaying Properties of Regular Objects

To display properties of regular objects

Select the object in the Object Explorer and click the Properties tab in the Object Viewer.

The Properties tab displays the properties for a selected regular object. Symbols in the Properties tab provide the following information about the object's class.

Symbol | Description
 | Indicates a key property.
 | Indicates a system property. System property names are preceded by a double underscore (for example, __SERVER). Note that you cannot change or delete system properties. Properties cannot begin with a double underscore because the double-underscore is a sequence that is reserved for system use. Non-system properties are either defined by the user or inherited from parent classes. For more information, see WMI System Properties in the Windows Management Instrumentation (WMI) section of the Platform SDK.
 | Indicates a local property.
 | Indicates an inherited property.
 | Indicates that the property is writeable.

A small triangle in the column head indicates which column is being used to sort the information and the sort direction (up or down). You can change how the information is sorted by clicking a column head.

The following example shows the properties of the Win32_CDRomDrive object.

See Also

Displaying Properties of Association Objects


Filtering Views of Object Properties

The default view of object data shows all properties — system, local, and inherited. You can filter this view to hide system and or inherited properties.

To filter views of object data

  1. Click the object to view and click the Properties tab.
  2. Click Views and then click Property Filters.
  3. Select or clear the filters for the desired view:
    • Show system properties
    • Show inherited properties

    Clearing these filters hides the properties in the Properties tab display.

  4. Click OK.


Editing Object Properties

You can edit the Value field of properties that are not read-only.

To edit a property value

  1. Display the Properties tab for the object to change.

    For instructions, see Displaying Properties of Regular Objects or Displaying Properties of Association Objects.

  2. Click the property value to change.
  3. If an arrow appears when you select the value, click the arrow and then choose a value from the list that appears.

    If no arrow appears, enter the new value in the field. When you start typing, the text turns blue and the Save button becomes available; this indicates that the value has not been committed yet.

  4. If the property type is an array, clicking Array in the Value field opens a dialog box, in which you can enter each value in the array. When you have finished entering values, click OK to return to the Properties tab.
  5. If the property type is an object, the Value field contains either <empty> (which represents NULL) or an Object button. To change this field, do one of the following:
    • Click Object to open the Embedded Object dialog box.

      You can edit properties and qualifiers from this box the same way as on the Object Viewer Properties tab. Click OK to return to the Object Viewer.

    • Right-click Object and click Set to <empty>.
    • Right-click the <empty> value and click Create Value.

      This opens the Embedded Object dialog box. Enter the name of the class to which the object belongs. The Properties tab for that class appears. You can edit properties and qualifiers the same way as on the Object Viewer Properties tab. Click OK to return to the Object Viewer.

  6. When you have finished editing, click Save.

    After the changes are saved, the text turns black.

Note Some property values are read-only and cannot be edited.


Displaying Instances

When you select a grouping node in the Object Explorer, the Object Viewer displays an instance table showing all objects in the namespace that belong to the selected group and the common properties of those objects.

From the instance table, you can also display the details for any individual instance. Right-click the instance and then click Go to Object or double-click the row corresponding to the instance to view. This displays the object Properties tab. To return to the instance table, you must reselect the grouping node.

The following screen shows the instance table for the Win32_SerialPort object group.


Displaying Object Methods

To display object methods

Select an object in the Object Explorer and then click the Methods tab in the Object Viewer.

The Methods tab shows all methods that can be applied to the selected object. You can display and execute object methods in the WMI Object Browser, but you can only edit method information in WMI CIM Studio.

To view the parameters defined for a method, right-click on the method row and click Execute Method. To view qualifiers for the method, right-click the method row and select Method Qualifiers.


Executing Object Methods

Methods can be executed on an object if they are implemented and not disabled (this is indicated by qualifiers on the method). If any of these conditions is not met for a certain method, the Execute Method context menu command is unavailable.

To execute a method

  1. Display the Methods tab for the object to work with.

    For more information, see Displaying Object Methods.

  2. Right-click the method and select Execute Method.

    The Method Parameters window shows the parameters used when executing the selected method. The Parameters column shows the parameters defined for this method and their default values.

  3. Before executing the method, set the values for these parameters by editing their values in this table.

    The direction of the parameters is indicated by the symbol in the first column.
    Symbol Description
    Indicates an input property.
    Indicates an output property.
    Indicates an input/output property.

  4. Click Execute. When the method is done executing, you can see the resulting parameter values, including the return value.


Displaying Object Associations

To display object associations

  1. Select an object in the Object Explorer and then click the Associations tab in the Object Viewer.
  2. The Associations tab graphically displays the objects associated with the current object.

The following screen shows all objects associated with the computer system EDKDOCS1, which is the root of the object tree in the example.

On the Associations tab:

  • The left-most symbol always represents the current object, EDKDOCS1 in the preceding screen shot.
  • Each branch from the current object represents an association of that object to another object.
  • The symbol in the middle ( [image]) represents the association object.
  • The right-most symbols represent the objects associated with the current object.

On the Associations tab, you can also:

  • Hover over the association object symbol to display the association type.
  • Hover over the connecting lines on each side of the association object symbol to display the roles of the related objects.
  • Jump to another regular object by double-clicking its symbol.

    For example, double-clicking the symbol next to Win32Service.Name="Messenger" in the preceding screen sample changes the display.

    Selecting another object on the Associations tab updates all displays in the Object Viewer. In this example, the Properties and Methods tabs now display information about the Messenger object.

  • Jump to an association object by double-clicking its symbol.

    In the preceding screen shot, the association object next to Win32Service.Name="LanmanWorkstation" is of the type Win32ServiceToService. Selecting this symbol changes the display.

    This also updates the Properties and Methods tabs to show information for the newly-selected association object.

  • Jump to the Properties tab of an object by right-clicking the object's symbol or name and clicking Properties.
  • Reroot the Associations graph by right-clicking an object symbol and clicking Make Root.
  • Open another namespace.

    Association graphs can contain objects from namespaces other than the current namespace. Right-click the object and select Go to Namespace to display the tree for the object's namespace.


Displaying Properties of Association Objects

To display the properties of an association object

On the Associations tab, double-click the symbol for the association object to display. Then, click the Properties tab. The property details for the selected association object appear.

You can also right-click an object in the Object Explorer and then select Association. The Object Viewer displays the details of the association object that links the selected object to the object above it.

See Also

Displaying Properties of Regular Objects


Editing Properties of Association Objects

You can edit the property values of association objects in the same way as regular objects. For instructions, see Editing Object Properties.


Displaying Object Qualifiers

To display object qualifiers

  1. Click an object in the Object Explorer and click the Properties tab in the Object Viewer.
  2. Right-click anywhere in the grid of the Object Viewer and select Object qualifiers.


Displaying Property Qualifiers

Property qualifiers can only be displayed for non-system properties.

To display property qualifiers

  1. Select an object in the Object Explorer and then click the Properties tab in the Object Viewer.
  2. Double-click the property whose qualifiers you want to display.

    —or—

    Right-click the property whose qualifiers you want to display. Select Property qualifiers.

    If the object has no property qualifiers, the Qualifiers window is blank.

  3. To close the Qualifiers window, click OK or Cancel.

The following screen shows the qualifiers for the Element property of the Win32_OperatingSystem object.


Editing Object and Property Qualifiers

To edit object and property qualifiers

  1. Select an object in the Object Explorer.
  2. Display the Qualifiers (object or property) window for the qualifiers to edit.
  3. Click the field to change. The Origin field is read-only and indicates where the qualifier originated:
    • local (for qualifiers defined in the current object)
    • propagated (for qualifiers propagated from another object)
  4. If an arrow appears when you select the field, click the arrow and choose a value from the list that appears.

    If no arrow appears, enter the new value in the field.

  5. Click the I, C, and O fields to select or cancel these settings.

    The Instances (I) field, if selected, specifies that this qualifier will be propagated automatically to all instances of this class. The Class (C) field, if selected, specifies that this qualifier will be propagated automatically to all classes derived from this class. The Overridable (O) field, if selected, permits this qualifier to be overridden.

    The Amended (A) field is selected if the qualifier was retrieved from a localized namespace. The column is read-only and cannot be changed by the user in an attempt to move a qualifier from the current to the localized namespace or from the localized to the current namespace. When adding new qualifiers, they are always created in the current namespace and are therefore created with this column cleared.

  6. When you finish editing, click OK to close the Qualifiers window.
  7. In the Object Viewer, click Save.


WMI CIM Studio

WMI Common Information Model (CIM) Studio is an application designed primarily for use by developers, particularly those who are writing providers and for advanced system managers. Using this application, you can:

  • Display the class inheritance tree for a CIM repository.
  • View details on classes and instances (properties, methods, qualifiers, and associations).
  • Edit class and instance information.
  • Run selected operations.

WMI CIM Studio also provides wizards for generating and compiling MOF files and for generating framework provider code. For more information about the WMI CIM Studio, see the following topics:

  • Starting WMI CIM Studio
  • WMI CIM Studio User Interface
  • WMI CIM Studio Functions


Starting WMI CIM Studio

To start WMI CIM Studio

  1. On the Start menu, point to Programs, and then click WMI Tools.
  2. Click WMI CIM Studio.
  3. In the Connect to namespace dialog box, select a namespace.

    The default namespace is Root\CIMV2. You can choose another namespace by typing its name or clicking Browse for Namespace.

  4. After selecting the namespace, click OK.

    For instructions about how to use the WMI Login dialog box, see WMI Application Logon.


WMI CIM Studio User Interface

WMI CIM Studio contains a Class Explorer and a Class Viewer. In general, when you select classes in the Class Explorer, their details appear in the Class Viewer. The WMI CIM Studio wizards generate and compile MOF files.

The following screen shot shows the WMI CIM Studio interface.


Class Explorer

The left pane in WMI CIM Studio is the Class Explorer. The Class Explorer shows the selected namespace (root\CIMV2 is the default) and the schema defined for that namespace as a class inheritance tree. The shaded symbols next to the class names indicate the type of objects defined by the class.

Symbol | Description
 | Defines a concrete regular class.
 | Defines an abstract regular class that has one or more concrete classes below it.
 | Defines an abstract regular class that has no concrete classes below it.
 | Defines a concrete association class.
 | Defines an abstract association class that has one or more concrete classes below it.
 | Defines an abstract association class that has no concrete classes below it.

Use the check boxes to select or cancel the selection of classes for the wizard operations performed in WMI CIM Studio. You can select or clear all check boxes by right-clicking anywhere in the Class Explorer and then clicking Select all or Unselect all.

For non-wizard operations, select classes by clicking the class name in the Class Explorer.

The Class Explorer includes the following buttons.

Button | Description
 | Browse for Namespace allows you to browse and select namespaces on the local computer or a remote computer. See Browsing for a Namespace.
 | Search for Class allows you to search for a specific class in the namespace. See Searching for a Class.
 | Add class adds a new class to the current repository. See Adding Class Definitions.
 | Delete class deletes a selected class from the current repository. See Deleting Class Definitions.


Class Viewer

The right pane in WMI CIM Studio is the Class Viewer, which displays details on a selected class. Using the tabs, you can display the properties, methods, and associations defined for a class. For additional information on these views, see Displaying the Definition of an Existing Class. Selecting a class in the Class Explorer automatically updates the Class Viewer display.

The Class Viewer includes the following buttons.

Button | Description
 | Create instance creates a new instance of a selected class. See Adding Instances of a Class for more details.
 | Delete instance deletes the selected instance. See Deleting Instances of a Class for more details.
 | Back/Forward display previously-viewed pages.
 | Save commits changed information to Windows Management.
 | Instances displays a table of all instances of a selected class. See Displaying an Instance Table.
 | Views displays filtered or custom views of class instance data. See Filtering Views of Class Properties
 | WQL Query opens the WQL query builder where you can compose, store, and execute WQL queries. See Using the WQL Query Builder.
 | Help for Class displays help information on the selected class or the class of the selected instance.

For a description of the symbols displayed when viewing the properties of an object, see Displaying Class Properties.


Wizards

The following wizards may be invoked in WMI CIM Studio.

MOF Generator Wizard inserts selected class definitions and/or instances from the repository into a text file in the MOF syntax.
MOF Compiler Wizard imports class definitions or instances described in a MOF file into the current repository.
Help opens the WMI online documentation.

When selected, each wizard opens a series of screens that guide you through the operation.


WMI CIM Studio Functions

Using the WMI CIM Studio, you can:

  • Display the class inheritance tree (schema) in a specified CIM repository.
  • Search for a specific class.
  • Display the definition of an existing class (properties, qualifiers, methods, and associations).
  • Display instances of an existing class (standard or custom views).
  • Extend and modify the existing schema by adding or deleting class definitions.
  • Modify a class by adding, editing, or deleting properties, qualifiers, and methods in a class definition.
  • Add or delete instances of a class.
  • Execute methods
  • Run the MOF file generator, and MOF file compiler on selected classes and/or instances.

Note If an error occurs while you are editing class properties or qualifiers (for example, if you enter a property type and value that are incompatible), a message box appears with a brief description of the problem. In some cases, Windows Management or the provider involved provide an error object with additional detailed information about the problem that occurred. Click Advanced to display the error object's properties. The property display contains more details on the problem that occurred.

Error objects are instances of the __ExtendedStatus class (or derivatives of this class).


Displaying a Class Inheritance Tree

By default, WMI CIM Studio sets the namespace to root\CIMV2, the default namespace on the local computer. You can view the class inheritance tree for any namespace in your system or on a network by specifying the namespace path in one of the following ways:

  • Specifying the namespace in the Classes in box
  • Selecting the namespace from the History list
  • Browsing for a namespace

Specifying the Namespace in the Classes in Box

The format for specifying a namespace in the Classes in box is as follows:

\\computer\root\namespace

For example, specifying \\EDKDOCS5\Root\CIMV2 displays the class inheritance tree for the Cimv2 namespace on the computer, EDKDOCS5. If no computer is specified, the default is the local computer. You can also specify a chain of namespaces, separating each with a backslash.

\\computer\root\namespace\namespace\namespace

Selecting a Namespace from the Classes in History List

The Classes in box keeps a list of previously-selected namespaces. Click the Classes in arrow to select a namespace from this history list.

Note The history list exists for the current session only. After you refresh or restart, the list disappears.


Searching for a Class

To search for a specific class in the namespace

  1. In the Class Explorer, click Search for Class.
  2. In the Search for Class dialog box, select one or more check boxes under Search Options to select the type of search to perform: by class name, class description, or property name. Property name searches that use system property names return no classes.
  3. Enter the full or partial text value (class name, class description, or property name) to use for this search.
  4. Click Go. The results of the search appear in the Search results pane.
  5. Click on the class to view, then click OK. This displays the chosen class in Class Explorer.


Displaying the Definition of an Existing Class

Within WMI CIM Studio, you can display the properties, qualifiers, and methods of an existing class.

  • Displaying Class Properties
  • Filtering Views of Class Properties
  • Displaying Class Methods
  • Displaying Class Qualifiers
  • Displaying Property Qualifiers in the Class Explorer
  • Displaying Method Qualifiers
  • Displaying Class Associations


Displaying Class Properties

To display properties of a class

Select the class in the Class Explorer and then click the Properties tab in the Class Viewer.

Symbols on the Properties tab provide the following information about the class.

Symbol | Description
 | Indicates a key property.
 | Indicates a system property. System property names are preceded by a double underscore (for example, __SERVER). Note that you cannot change or delete system properties. You should not create properties that begin with a double underscore. Non-system properties are either defined by the user or inherited from parent classes. For more information, see WMI System Properties in the Windows Management Instrumentation (WMI) section of the Platform SDK.
 | Indicates a local property.
 | Indicates an inherited property.
 | The pen on a symbol indicates that the property is writable.
 | Displays a dialog box that shows the values contained in a property array.

A small triangle in the column head indicates which column is being used to sort the information and the sort direction (up or down). You can change how the information is sorted by clicking a column head.

The following example screen shows the properties for the Win32_Printer class.


Filtering Views of Class Properties

The default view of class data shows all properties — system, local, and inherited. You can filter this view to hide system and inherited properties.

To filter views of object data

  1. Select the class to view in the Class Explorer and click the Properties tab in the Class Viewer.
  2. Click Views and select Property Filters.
  3. Select or clear the filters for the desired view:
    • Show system properties
    • Show inherited properties

    Clearing these filters hides the properties in the Properties tab display.

  4. Click OK.


Displaying Class Methods

To display class methods

Select the object in the Class Explorer and click the Methods tab in the Class Viewer.

The Methods tab shows all methods that can be applied to the selected class. For more information, see Executing Methods in CIM Studio.


Displaying Class Qualifiers

To display class qualifiers

  1. Select a class in the Class Explorer and click the Properties tab in the Class Viewer.
  2. Right-click the Properties tab and select Object qualifiers.


Displaying Property Qualifiers in the Class Explorer

Property qualifiers can only be displayed for non-system properties.

To display property qualifiers

  1. Select a class in the Class Explorer and click the Properties tab in the Class Viewer.
  2. Double-click the property whose qualifiers you want to display.

    —or—

    Right-click the property whose qualifiers you want to display and select Property qualifiers. If the class has no property qualifiers, the Qualifiers window is blank.

  3. To close the Qualifiers window, click OK or Cancel.


Displaying Method Qualifiers

To display method qualifiers

  1. Select a class in the Class Explorer and click the Methods tab in the Class Viewer.
  2. Right-click the method whose qualifiers you want to view and select Method Qualifiers.
  3. To close the Qualifiers window, click OK or Cancel.


Displaying Class Associations

To display class associations

  1. Select a class in the Class Explorer and click the Associations tab in the Class Viewer.

The class Associations tab, displayed when viewing a class (as opposed to an instance), graphically displays all associations that objects of this class can have with other objects in the namespace. This is a representation of the schema definition of which association classes can connect instances of this class to instances of other classes. The following screen shows classes whose instances could be associated to instances of the Win32_MotherboardDevice class.

On the class Associations tab:

  • The left-most object symbol always represents the current class (Win32_MotherboardDevice in the preceding screen sample).
  • Each branch from the current class represents an association of that class to another class.
  • The symbol in the middle ( [image]) represents the association object class.
  • The right-most symbols represent the classes associated with the current class.

On the class Associations tab, you can:

  • Hover over the association object symbol to display the association type.
  • Hover over the connecting lines on each side of the association object symbol to display the roles of the related classes.
  • Jump to another class by double-clicking its symbol.

    For example, double-clicking the symbol next to CIM_System in the preceding screen sample changes the display.

    Selecting another class on the class Associations tab updates all displays in the Class Viewer. In this example, the Properties and Methods tabs now display information about the CIM_System class.

  • Jump to an association object by double-clicking its symbol.

    In the preceding screen sample, the association object next to CIM_Setting is of the type CIM_ElementSetting. Selecting this symbol changes the display and updates the Properties and Methods tabs to show information for the newly-selected association object.

  • Jump to the Properties tab of an object by right-clicking the object's symbol and selecting Properties.


Displaying Instances of an Existing Class

Within WMI CIM Studio, you can open a table of all instances of a class and view the associations of an instance. You can also define and display custom views of instances.

  • Displaying an Instance Table
  • Displaying Associations of an Instance


Displaying an Instance Table

You can open an instance table for any class in the namespace. An instance table shows all instances of the selected class in the namespace and their common properties.

To display the instance table

  1. Select a class in the Class Explorer and click Instances ( [image]) in the Class Viewer. If there are no instances of the class, the instance table displays the message, "No Instances Available."
  2. To display the details for any individual instance, right-click the instance in the instance table, and then select Go to Object.

    This displays the object's Properties tab. Clicking Instances toggles the display between the instance table and the Properties tab for the selected object.

The following example screen shows all instances of the Win32_ProgramGroup class.


Displaying Associations of an Instance

To display object associations

  1. Select a class in the Class Explorer.
  2. Click Instances ( [image]) in the Class Viewer. If there are no instances of the class, the instance table displays the message, "No Instances Available."
  3. To display the details for any individual instance, right-click the instance in the instance table and then click Go to Object.

    This displays the object's Properties tab. Clicking Instances toggles the display between the instance table and the Properties tab for the selected object.

  4. Click the Associations tab in the Class Viewer.

    The Associations tab graphically displays the objects associated with the current object.

The following screen shows all objects associated with the computer system, EDKDOCS1, which is the root of the object tree in the example.

On the Associations tab:

  • The left-most object symbol always represents the current object, EDKDOCS1, as shown in the preceding screen sample.
  • Each branch from the current object represents an association of that object to another object.
  • The symbol in the middle ( [image]) represents the association object.
  • The right-most object symbols represent the objects associated with the current object.

On the Associations tab, you can also:

  • Hover over the association object symbol to display the association type.
  • Hover over the connecting lines on each side of the association object symbol to display the roles of the related objects.
  • Jump to another regular object by double-clicking its symbol.

    For example, double-clicking the symbol next to Win32Service.Name="Messenger" in the preceding screen sample changes the display.

    Selecting another object on the Associations tab updates all displays in the Class Viewer. In this example, the Properties and Methods tabs now display information about the Messenger object.

  • Jump to an association object by double-clicking its symbol.

    In the preceding screen sample, the association object next to Win32Service.Name="LanmanWorkstation" is of the type Win32ServiceToService. Selecting this symbol changes the display and updates the Properties and Methods tabs to show information for the newly-selected association object.

  • Jump to the Properties tab of an object by right-clicking the object's symbol or name and clicking Properties.
  • Reroot the associations graph by right-clicking an object symbol and selecting Make Root.
  • Open another namespace.

    Association graphs can contain objects from namespaces other than the current namespace. Right-click the object and select Go to Namespace to display the tree for the object's namespace.


Adding Class Definitions

To add a class

  1. In the Class Explorer, select the class from which to derive a new class.
  2. Click Add Class.
  3. In the Add Class dialog box, enter the name of the new class in the New Class box and then click OK.

    The Class Viewer displays the new class in the Properties tab, showing all the parent class's properties that are inherited by the new class.

Note When defining a new class which is an association, the user must define a Boolean object qualifier on the Association class and set it to TRUE to define that this is an association class. This qualifier must be propagated to all instances of the class, so check the "I" box in the qualifier definition.

To add a class at the top level

  1. In the Class Explorer, click Add Class.
  2. In the Add Class dialog box, erase any Parent value (this box should be blank).
  3. Enter the name of the new class in the New Class box and click OK.

For more information on adding properties to a new class, see Adding Class Properties.


Deleting Class Definitions

To delete a class

  1. In the Class Explorer, select the class to delete and click the Delete Class button on the toolbar.
  2. In the Delete Class Query dialog box, click Yes.

Note When you delete a class, all of its child classes are also deleted.


Modifying Class Definitions

You can modify a class by adding, editing, or deleting properties, qualifiers, and methods in a class definition.

  • Adding Class Properties
  • Renaming Classes in WMI CIM Studio
  • Deleting Class Properties
  • Editing Class Properties
  • Using the Interval Editor
  • Adding Class Methods
  • Deleting Class Methods
  • Editing Class Method Parameters
  • Adding Class, Property, or Method Qualifiers
  • Deleting Class, Property, or Method Qualifiers
  • Editing Class, Property, or Method Qualifiers

Note You cannot change the definition of a class that has subclasses because such changes can result in inconsistencies in the subclasses that cannot be reconciled. Making changes to a class that has subclasses will result in an error when trying to save these changes.


Adding Class Properties

To add a property

  1. Select the class to change in the Class Explorer. Click the Properties tab in the Class Viewer.
  2. Click the blank Name field at the bottom of the properties table and enter the new property name.
  3. Click the Type field, click the arrow, and then choose a property type from the list that appears.

    When you select the type, a default value may appear in the Value field. The Value field will determine the default value for this property. Whenever an instance of this class is created, the value you specify now will be the default value for this property.

  4. For a value other than the default in the Value field, click the field and enter the desired value.

    When you select this field and begin typing, a list may appear from which you can choose the appropriate value.

  5. If the property type is an array, click Array in the Value field to open a dialog box in which you can enter each value in the array. When you are done entering values, click OK to return to the Properties tab.
  6. To create an embedded object, do the following steps in order:
    1. Select object as the property type.
    2. Optionally, enter the name of the class to which the embedded object belongs and then click OK.
    3. By default, the Value field is set to <empty> (which represents NULL). To change this value, right-click the field, and then click Create Value.

      If you previously entered the name of the class to which the embedded object belongs, the Embedded Object dialog box opens the Properties tab for that class. Otherwise, the display is blank.

    4. Enter the name of the class to which the embedded object belongs in the Class field and press ENTER to display the Properties tab for that class.
    5. Edit the properties and/or qualifiers for the embedded object, if necessary, and then click OK to return to the Class Viewer.
  7. Click Save to save your changes.


Renaming Classes in WMI CIM Studio

To rename a class

  1. In Class Explorer, right-click the class to rename and click Rename Class.

    Or click the class, wait briefly, then click it a second time (the two mouse clicks should be spaced far enough apart so Windows does not interpret them as a double-click).

  2. A warning message explains that any static instances belonging to the renamed class will be deleted. Click Yes to continue.

    The original class name will be selected.

  3. Enter the new class name and press ENTER.


Deleting Class Properties

To delete a property

  1. Select a class in the Class Explorer and click the Properties tab in the Class Viewer.
  2. Click the gray box to the left of the property to delete.

    This step selects the entire property entry.

  3. Press the DELETE key.
  4. Click OK to delete the property.
  5. Click Save to save your changes.


Editing Class Properties

To edit a property field

  1. Click a class in the Class Explorer and click the Properties tab in the Class Viewer.
  2. Click the field to change.
  3. If an arrow appears when you select the field, click the arrow and choose a value from the list that appears.

    —or—

    If no arrow appears, enter the new value in the field.

    When you start typing, the text turns blue, and the Save button becomes active. This indicates that the value has not been committed yet.

  4. If you edit a Value field that contains an array, a dialog box appears that shows each value in the array. Edit the values to change and then click OK to return to the Properties tab.
  5. If the property type is an object, the Value field contains either <empty> (which represents NULL) or an Object button.

    To change the Value field, do one of the following:

    • Click Object to open the Embedded Object dialog box.

      You can edit properties and qualifiers from this dialog box in the same way as on the Class Viewer Properties tab. Click OK to return to the Class Viewer.

    • Right-click Object and select Set to <empty>.
    • Right-click the <empty> value and select Create Value.

      This step opens the Embedded Object dialog box. Enter the name of the class to which the object belongs. The Properties tab for that class appears. You can edit properties and qualifiers the same way as on the Class Viewer Properties tab. Click OK to return to the Class Viewer.

  6. When you have finished editing, click Save. After the changes are saved, the text turns black.


Using the Interval Editor

An interval is a form of the DATETIME data type that represents an interval of time. Typically, intervals are stored as large integers, which often makes them difficult to work with. WMI simplifies working with intervals by displaying them in a human-readable form using days, hours, minutes, and seconds. By providing an interval editor that lets you add or edit intervals in a human-readable format, WMI also simplifies the task of adding or editing intervals.

You can make a property describe an interval by defining the property as having a DATETIME data type and then defining a qualifier for this property named subtype with a value of "Interval". To add an interval property to a class and set an interval value for the property using the interval editor, follow this procedure.

To add an interval property to a class

  1. Select a class to edit.
  2. On the Properties tab in Class Viewer, add a property with a type of DATETIME.
  3. Right-click the property and select property qualifiers from the context menu.
  4. In the Property Qualifiers dialog box, enter a qualifier named "subtype" and set its value to "interval".
  5. Click OK.

    When you attempt to enter a value for the property, the interval editor will appear.

    The top box is used to specify the number of days in the interval. The bottom box is used to specify hours, minutes, and seconds.

    For more information about intervals, see Interval Format in the Windows Management Instrumentation (WMI) section of the Platform SDK.


Adding Class Methods

You can add methods only to classes, not instances.

To add a method

  1. Display the Methods tab for the class with which to work. For more information see Displaying Class Methods.
  2. Enter the method name in the Name box.
  3. Define the method's qualifiers.

    For more information see Adding Class, Property, or Method Qualifiers in this documentation, or the Declaring Methods and Using Qualifiers topics in the Windows Management Instrumentation (WMI) section of the Platform SDK.

  4. To define the method's parameters, right-click the method and click Edit Method Parameters.
  5. In the Method Parameters window, for each input and output parameter, enter the parameter Name, Type, and Value.
  6. Click OK to save the parameters and return to the Methods tab.

    —or—

    Click Apply to save the changes and remain in the Method Parameters window.


Deleting Class Methods

You can delete methods only from classes, not instances.

To delete a method

  1. Display the Methods tab for the class to work with.

    See Displaying Class Methods.

  2. Click the gray box to the left of the method to delete.

    This selects the entire method entry.

  3. Click Delete.
  4. Click OK to delete the method and click Save.


Editing Class Method Parameters

You can add, edit, or delete method parameters for classes. For instances, you can only edit method parameter values.

To edit method parameters

  1. Display the Methods tab for the class or instance to edit.

    See Displaying Class Methods.

  2. Right-click the method to edit and select Edit Method Parameters.
  3. In the Method Parameters window, select and edit the fields to change.

    In some cases, selecting an item produces a list, from which you can select new values.

  4. Click OK to save the changes and return to the Methods tab.

    —or—

    Click Apply to save the changes and remain in the Method Parameters window.


Adding Class, Property, or Method Qualifiers

To add qualifiers

  1. Open the Qualifiers window for the desired class, property, or method. For instructions, see Displaying Class Qualifiers, Displaying Property Qualifiers, or Displaying Method Qualifiers.
  2. Click the blank Name field and select a standard qualifier from the list or enter a new qualifier name.

    When you complete the Name field, default entries appear in the remaining fields. The Origin field is read-only and indicates where the qualifier originated:

    • local (for qualifiers defined in the current object)
    • propagated (for qualifiers propagated from another object)
  3. To accept the defaults and close the Qualifiers window, click OK. See step 8 for instructions on saving the new qualifiers.

    To override the defaults, see steps 4 through 8.

  4. Click the Type field and choose a type from the list.

    When you select the type, a default value may appear in the Value field.

  5. Click the I, C, and O fields to select or cancel these settings.

    The Instances (I) field, if selected, specifies that this qualifier will be propagated automatically to all instances of this class. The Class (C) field, if selected, specifies that this qualifier will be propagated automatically to all classes derived from this class. The Overridable (O) field, if selected, permits this qualifier to be overridden.

    The Amended (A) field is selected if the qualifier was retrieved from a localized namespace. The column is read-only and cannot be changed by the user in an attempt to move a qualifier from the current to the localized namespace or from the localized to the current namespace. When adding new qualifiers, they are always created in the current namespace and are therefore created with this column cleared.

  6. Click the Value field and enter the desired value.

    When you select this field and begin typing, a list may appear from which you can choose the appropriate value.

  7. When you have finished editing, click OK to close the Qualifiers window.
  8. In the Class Viewer, click Save to save your changes.


Deleting Class, Property, or Method Qualifiers

To delete qualifiers

  1. Open the Qualifiers window for the desired class, property, or method. For instructions, see Displaying Class Qualifiers, Displaying Property Qualifiers, or Displaying Method Qualifiers.
  2. Click the gray box to the left of the qualifier to delete. This selects the entire qualifier entry.
  3. Press the Delete key.
  4. Click OK to delete the qualifier.
  5. Click OK to close the Qualifiers window.
  6. In the Class Viewer, click Save to save your changes.


Editing Class, Property, or Method Qualifiers

To edit qualifiers

  1. Open the Qualifiers window for the desired class, property, or method. For instructions, see Displaying Class Qualifiers, Displaying Property Qualifiers, or Displaying Method Qualifiers.
  2. Click the field to change. The Origin field is read-only and indicates where the qualifier originated:
    • local (for qualifiers defined in the current object)
    • propagated (for qualifiers propagated from another object)

    If an arrow appears when you select the field, click the arrow and choose a value from the list that appears. If no arrow appears, type the new value in the field.

  3. Click the I, C, and O fields to select or cancel these settings.

    The Instances (I) field, if selected, specifies that this qualifier will be propagated automatically to all instances of this class. The Class (C) field, if selected, specifies that this qualifier will be propagated automatically to all classes derived from this class. The Overridable (O) field, if selected, permits this qualifier to be overridden.

    The Amended (A) field is selected if the qualifier was retrieved from a localized namespace. The column is read-only and cannot be changed by the user in an attempt to move a qualifier from the current to the localized namespace or from the localized to the current namespace. When adding new qualifiers, they are always created in the current namespace and are therefore created with this column cleared.

  4. When you have finished editing, click OK to close the Qualifiers window.
  5. In the Class Viewer, click Save.
  6. Click Yes to save your changes.


Adding Instances of a Class

To add an instance of a class

  1. In the Class Explorer, select the class for which to create an instance.
  2. Click Create instance in the Class Viewer.

    The viewer displays data for the new instance.

  3. Enter values for the key property fields.

    For information on editing properties, see Editing Class Properties.

  4. When you have finished editing the key fields, click Save.

Note You cannot add instances of abstract classes. An abstract class is used only as a template for derived classes and cannot have instances. You cannot add instances to any class with children (subclasses). The class you add to must have at least one key property.


Deleting Instances of a Class

To delete an instance of a class

  1. Open the instance table for the desired class. For instructions, see Displaying an Instance Table.
  2. Click the gray box to the left of the instance to delete.

    This selects the entire instance entry.

  3. Click Delete instance in the Class Viewer.
  4. You will see the Deleting an Instance dialog box. Click Yes to delete the instance.


Executing Methods in CIM Studio

Regular methods can be executed on instances, if they are implemented and not disabled (marked by qualifiers on the method). Methods marked with the [static] qualifier can also be executed on a class. You can execute methods on instances or on classes defined as static but not on instances of static classes.

To execute a method

  1. Display the Methods tab for the object to work with. For a class, select the class in the Class Explorer and click the Methods tab in the Class viewer. For an instance, do these steps in order:
    1. Click the class in the Class Viewer and click Instances ( [image]).
    2. Right-click the instance to work with and select Go to Object.
    3. Click the Methods tab.
  2. Right-click the method and select Execute Method.
  3. The Parameters column shows the parameters defined for this method and their default values. Before executing the method, set the values for the parameters by editing their values in this table.

    The direction of the parameters is indicated by the symbol in the first column.
    Symbol Description
    Indicates an input property.
    Indicates an output property.
    Indicates an input/output property.

  4. Click Execute.

    When the method is done executing, you can see the resulting parameter values, including the return value.


Using the WQL Query Builder

The WQL Query Builder lets you write, save, and execute WMI Query Language (WQL) queries.

To use the WQL Query Builder

  1. Click the WQL Query symbol in the Class Viewer ( [image]).
  2. To use a query, select the query from the list of available queries and click Execute.
  3. To compose and execute a new query, enter the new query in the Query box, and then click Execute. To save this query, enter a new name in the Name box, and then click Save Query. The query will be added to the list of available queries.

    For example, to create a query that displayed an instance of Win32_Process with a process name of "Winmgmt.exe", you would enter the following information:

    SELECT * FROM Win32_Process WHERE Name="winmgmt.exe"
  4. To edit an existing query, select the query to edit from the list of available queries and make changes to the information in the Query box. Click Save Query and the query will be updated.
  5. To delete an existing query, select the query to delete from the list of available queries and click Remove Query and the query will be deleted.

For more information about queries, see WMI Query Language in the Windows Management Instrumentation (WMI) section of the Platform SDK.


Using the MOF Generator Wizard

The MOF Generator Wizard generates a MOF file for class definitions and/or instances from an existing repository. Typically, you run this wizard when you have created a new class or when you want to port existing repository information to another computer.

To generate a MOF file

  1. In the Class Explorer, select the check boxes of the classes to insert in the MOF file.
  2. Double-click the MOF Generator Wizard symbol.
  3. On the welcome screen, click Next.

    The next screen shows each class selected in step 1.

  4. For each class, do the following steps in order:
    • Select the class name from the Classes to generate code for list. The instances of that class, if any, appear in the right pane.
    • Choose whether you want the class definition in the MOF file by selecting the Include class definition check box.
    • Select the check boxes for the instances to be included in the MOF file. If you want all instances to be included, click Select All.
  5. Click Next.
  6. Enter a file name in the MOF File Name box and the directory where you want it to reside, or use Browse to select a directory.
  7. To generate a Unicode MOF file, select the UNICODE check box.
  8. Click Finish.
  9. Click OK to confirm MOF file generation and close the wizard.


Using the MOF Compiler Wizard

The MOF Compiler Wizard compiles the MOF file into a repository, importing any class definitions or instances from the MOF file into the current repository. You can also use this wizard to check the syntax of a MOF file and to create a binary MOF file.

  • Compiling a MOF File
  • Logging on to the MOF Compiler Wizard
  • Checking the Syntax of a MOF File
  • Creating a Binary MOF File


Compiling a MOF File

To compile a MOF file

  1. Double-click the MOF Compiler Wizard symbol in the Class Viewer. When the welcome screen appears, select Compile a .MOF file.
  2. Click Next.
  3. Enter the path and file name for the MOF file to compile (or use Browse to find the file). Then, enter the namespace where the MOF file should be loaded.

    If you select a namespace on a remote computer, click Username to display a login dialog box. Enter your user name and password for the computer where the namespace resides and click OK. Note that MOF files containing the #pragma namespace directive will override this selection.

  4. Click Next.
  5. Select or cancel the selection of the appropriate compiler options.

    You can modify classes and instances that are already in the namespace, and add new classes and instances to the namespace.

  6. Click Finish to compile the file.
  7. Click OK to confirm successful compilation.


Logging on to the MOF Compiler Wizard

Use the MOF Compiler Wizard User Credentials dialog box to provide information when compiling a MOF file on a remote computer. You can reach this dialog box by clicking Username in the MOF Compiler Wizard.

You can connect to a remote computer as either the current user or a different user. If you do not specify a user name or password, the credential's of the current user will be used. Otherwise, enter a valid user name and password for the remote computer.

To complete the MOF Compiler Wizard User Credentials dialog box

  1. If you are logging on as the current user on the remote computer, click OK.
  2. If you are logging in on a remote computer with credentials that are different than the current user, enter your information in Username and Password. The user name can be in the form domain\user.
  3. Enter the kind of authentication to use in Authority.
    • If the text you enter in Authority begins with the string "kerberos:", Kerberos authentication will be used and the text in Authority should contain a Kerberos principal name. For example, Kerberos:<principal name>.
    • If the text you enter in Authority begins with the string "NTLMDOMAIN:", NTLM authentication will be used and text in Authority should contain a NTLM domain name. For example, NTLMDOMAIN:<domain name>.
    • If you leave this box empty when connecting to a remote system, the operating system will negotiate with DCOM to determine whether NTLM or Kerberos authentication will be used
  4. Click OK.

Note The MOF Compiler Wizard User Credentials dialog box should only be used when connecting to remote namespaces. The connection will fail and you will see an error if you attempt to provide user credentials for a local connection.

You must be an authorized WMI user on a remote system before you will be allowed to connect to the remote system. You can use the WMI Control application on the remote system to set permissions for WMI users. The WMI Control help file documents how to use this control.

To execute the WMI Control application

From the Start menu, click Run and enter Wbemcntl (in Windows 95/98 and Microsoft® Windows NT® version 4.0). In Windows 2000, enter Wmimgmt.msc.


Checking the Syntax of a MOF File

To check the syntax of a MOF file

  1. Double-click the MOF Compiler Wizard symbol in the Class Viewer. When the welcome screen appears, select Check the syntax of a .MOF file.
  2. Click Next.
  3. Enter the path and file name for the MOF file to check or use Browse to find the file.
  4. Click Finish.

    The wizard checks the file's syntax and reports the results in a message box.

  5. Click OK.


Creating a Binary MOF File

To create a binary MOF file

  1. Double-click the MOF Compiler Wizard symbol in the Class Viewer. When the welcome screen appears, select Create a binary .MOF file.
  2. Click Next.
  3. Enter the path and file name for the MOF file to compile or use Browse to find the file.
  4. Enter the name of the binary MOF file to be created.
  5. Enter the directory where the binary MOF file should be created or use Browse to find a directory.
  6. To perform syntax checks, select the Perform WMI syntax checks check box.

    This option is only used for building binary MOF files for use by WDM device drivers. Choosing this option invokes a separate binary MOF file checker, which runs after the binary MOF file is created. To use this option under Windows 2000, the Windows 2000 DDK must first be installed.

  7. Click Next.
  8. Select or cancel the selection of the appropriate compiler options.

    You can modify classes and instances that are already in the namespace, and you can add new classes and instances to the namespace.

  9. Click Finish to compile the file.
  10. Click OK to confirm successful compilation.

Note You can also use the WMI MOF compiler to create binary MOF files from the command line. For more information about compiling binary MOF files, see the mofcomp topic in the Windows Management Instrumentation (WMI) section of the Platform SDK.


WMI Event Registration Tool

The WMI Event Registration Tool is designed for developers and system managers. It provides a graphical interface for what may also be accomplished programmatically. The WMI Event Registration Tool allows you to create, display, and modify the event consumers, filters, and timers for a given namespace and any bindings between filters and consumers. By using the WMI Event Registration Tool, you can do the following:

  • View properties of the defined consumer, filter, and timer system classes and instances.
  • Add or delete event consumer instances.
  • Add or delete event filter instances.
  • Add or delete event timer instances.
  • Edit instance properties.
  • Register consumers for events by binding consumer and filters.

Note You must install Windows Management and create a repository of classes on the target computer before you can use the WMI Event Registration Tool. One of the methods for creating a repository of classes is to compile a MOF file in the system directory where the WMI Core is installed. To compile the MOF file, type the following at the command-line prompt:

mofcomp <filename.mof>.

For more information, see the mofcomp topic in the Windows Management Instrumentation (WMI) section of the Platform SDK.

The examples in the following topics use the Eviewer.mof file found in the WMI Tools. This MOF file contains the classes and instances required to declare and register the WMI Event Viewer consumer provider with the Event subsystem. This MOF file is compiled automatically when Windows Management is first started, so that the WMI Event Viewer consumer is registered as a permanent event consumer by default. For more information on the required schema for this type of registration, see Registering a Provider, Registering a Class Provider, and Registering an Instance Providers topics in the Windows Management Instrumentation (WMI) section of the Platform SDK.

To open the WMI Event Registration Tool

  1. From Start, point to Programs and click WMI Tools.
  2. Click Event Registration. For instructions in using the WMI Login dialog box, see WMI Application Logon.

See Also

Receiving a Timed or Repeating Event and Using Permanent Event Consumers in the Windows Management Instrumentation (WMI) section of the Platform SDK.


WMI Event Registration Tool Interface

The left pane of the WMI Event Registration Tool displays the event related classes. The right pane displays any bindings you have defined between consumers and filters. An example of a WMI Event Registration Tool screen is shown below.

The left pane of the WMI Event Registration Tool shows the inheritance tree for the event-related classes (consumers, filters, and timers) contained in the current namespace. You can select the inheritance tree that will be displayed from the list box in the upper left corner of this window. Next to the first list box is another list that allows you to select the current namespace. By default, the root\CIMV2 namespace on the local computer is displayed. You can select a different namespace or a namespace on a remote computer. The tree shows system classes and instances of those classes.

The left pane of the WMI Event Registration Tool includes the following buttons and symbols.

Button | Description
 | Browse for Namespace allows you to browse and select namespaces on the local computer or a remote computer.
 | New Instance allows you to define another instance of the selected consumer, filter, or timer.
 | Edit Instance Properties allows you to view and modify some properties of the selected instance.
 | Delete Instance deletes the selected instance.
 | A symbol that denotes a class.
 | A symbol that denotes an instance.

The right pane of the WMI Event Registration Tool shows the bindings you have defined between consumers and filters. If you select consumers in the left pane, filters appear in the right pane. Similarly, if you select filters in the left pane, consumers appear in the right pane.

The right pane of the WMI Event Registration Tool includes the following buttons:

Button | Description
 | Register registers the selected filter-consumer combination.
 | View Instance Properties allows you to view some properties of the selected instance.


WMI Event Registration Tool Functions

This section describes the functions you can perform in the WMI Event Registration Tool:

  • Viewing class properties
  • Creating an event consumer instance
  • Creating an event filter instance
  • Creating an event timer instance
  • Registering a consumer for an event


Viewing Class Properties

Although you cannot modify any properties of a system class, you can view its properties.

To view class properties

In the left pane of the WMI Event Registration Tool, click the class and then click View Class Properties.

—or—

In the left pane of the WMI Event Registration Tool, right-click a class and then select View Class Properties.

See Also

WMI Event Registration Tool Functions


Creating an Event Consumer Instance

You create event consumers as instances of a given class. This version of WMI contains a predefined EventViewerConsumer class, which is a subclass of the __EventConsumer system class.

To create an event consumer instance

  1. From the list of inheritance trees, select Consumers.
  2. Expand the tree associated with the system class __EventConsumer.
  3. Click the class you want to instantiate, and click the New Instance button.

    —or—

  4. Right-click the class to instantiate, and select New Instance.
  5. In the Edit new instance properties dialog box, enter strings in the Description and Name boxes, and enter a value in the Severity box.
  6. Click OK to create the instance.

As an example, the following information would define an instance that, when used with the ServiceStoppedEvent filter, triggers an event notification and displays it in WMI Event Viewer when a system service is stopped.

  • In the Description box, enter Service was stopped.
  • In the MachineName box, enter the computer name (without \\) to identify the computer that will RECEIVE/CONSUME the events bound to this consumer. Leave this field blank to specify the local computer.
  • In the Name box, enter ServiceStopped.
  • In the Severity box, enter 1.

Another example would define a consumer that works with IntervalTimerFilter or AbsTimerFilter. This triggers an event notification and displays it in the WMI Event Viewer at regular intervals or at a particular date and time.

  • In the Description box, enter TimerEventReceived.
  • In the Name box, enter TimerEvent.
  • In the Severity box, enter 2.

See Also

WMI Event Registration Tool Functions. __EventConsumer and Using Permanent Event Consumers in the Windows Management Instrumentation (WMI) section of the Platform SDK.


Creating an Event Filter Instance

Event filters define criteria for receiving event notifications. You create event filters as instances of a given class. This version of WMI contains the predefined __EventFilter system class.

To create an event filter instance

  1. From the list of inheritance trees, select Filters.
  2. Click the class you want to create an instance and then click New Instance.

    —or—

    Right-click the class, and then click New Instance.

  3. In the Edit new instance properties dialog box, enter the following information:
    • In the Name box, enter a name for the filter.
    • In the Query box, enter a WQL SELECT statement that specifies the event criteria.
    • In the Query Language box, enter WQL.
  4. Click OK to create the instance.

As an example, the following information would define a filter that works with the ServiceStopped consumer to display an event message in WMI Event Viewer when a system service is stopped.

  • In the Name box, enter ServiceStoppedEvent.
  • In the Query box, enter the following WQL SELECT statement to specify the event criteria:
    SELECT * FROM __InstanceModificationEvent WITHIN 5 WHERE TargetInstance isa "Win32_Service" AND TargetInstance.State="Stopped"
  • In the Query Language box, enter WQL.

As another example, this information would define a filter that works with the TimerEvent consumer and IntervalTimer to display an event notification in WMI Event Viewer every 5 seconds.

  • In the Name box, enter IntervalTimerFilter.
  • In the Query box, enter the following WQL SELECT statement to specify the event criteria:
    SELECT * FROM __TimerEvent
  • In the Query Language box, enter WQL.

This information would define a filter that works with the TimerEvent consumer and AbsTimer to display an event notification in WMI Event Viewer at a specified date and time.

  • In the Name box, enter AbsTimerFilter.
  • In the Query box, enter the following WQL SELECT statement to specify the event criteria:
    SELECT * FROM __TimerEvent WHERE TimerId="AbsTimer"
  • In the Query Language box, enter WQL.

See Also

WMI Event Registration Tool Functions, __EventFilter, Creating an Event Filter, WMI Query Language, Event Queries (in the Windows Management Instrumentation (WMI) section of the Platform SDK)


Creating an Event Timer Instance

Timer events may be of the absolute or interval type. Absolute timer events occur at a particular date and time, while interval timer events occur at regular intervals.

You create event timers as instances of a given class. This version of the WMI Event Registration Tool provides two subclasses of __TimerInstruction: __AbsoluteTimerInstruction and __IntervalTimerInstruction. You can create an instance with either or both of these. For more information see these classes in the Windows Management Instrumentation (WMI) section of the Platform SDK.

To create an absolute event timer instance

  1. From the list of inheritance trees, select Timers.
  2. Expand the tree to expose the subclasses.
  3. Click __AbsoluteTimerInstruction and then click New Instance.

    —or—

    Right-click __AbsoluteTimerInstruction and then click New Instance.

  4. In the Edit new instance properties dialog box, click the Value field of the EventDateTime row.
  5. In the Time dialog box, set the date, time, and time zone, and then click OK. The date and time must be valid for an event to occur.
  6. In the TimerId field of the Edit new instance properties dialog box, enter a name for the timer.
  7. Click OK to create the instance.

The following example would create an absolute timer instruction that works with the TimerEvent consumer and AbsTimerFilter to display an event notification in the WMI Event Viewer at a particular date and time.

  • In the TimerId box of the Edit new instance properties dialog box, enter AbsTimer.

To create an interval event timer instance

  1. From the list of inheritance trees, select Timers.
  2. Expand the tree to expose the subclasses.
  3. Click __IntervalTimerInstruction and click the New Instance button.

    —or—

    Right-click on __IntervalTimerInstruction and select New Instance.

  4. In the Edit new instance properties dialog box, in the IntervalBetweenEvents box, enter a value in milliseconds.
  5. In the TimerId box, enter a name for the timer.
  6. Click OK to create the instance.

The following example would create an interval timer that works with the TimerEvent consumer and AbsTimerFilter to display an event message in WMI Event Viewer at regular intervals.

  • In the IntervalBetweenEvents box, enter 5000. This means that the event notification will occur every 5000 milliseconds (every 5 seconds).
  • In the TimerId box, enter IntervalTimer.

See Also

Receiving a Timed or Repeating Event topic in the Windows Management Instrumentation (WMI) section of the Platform SDK


Registering a Consumer for an Event

To register to receive an event notification, permanent consumers must create at least one of each of the following instances, which are then registered together in a process called binding:

  • Event consumer instance
  • Event filter instance

To register an event consumer for an event

  1. Select Consumers in the list of inheritance trees.
  2. Expand the whole inheritance tree, then select a consumer instance in the left pane (for example, the ServiceStopped consumer created in Creating an Event Consumer Instance).
  3. In the right pane, click the matching filter (for example, the ServiceStoppedEvent filter created in Creating an Event Filter Instance).
  4. Click Register. (The name of the Register button now changes to Unregister. Click it to unregister the selected consumer and filter.)

Note You should check the event log for errors after registering an event consumer because if an error occurs during an event consumer binding Windows Management will issue this error to Event Log.

To test the ServiceStopped consumer-filter binding after registration, open Services in Control Panel. On Microsoft® Windows® 2000 platforms, Services is in the component services folder, which is inside the administrative tools folder. Find a running service that can be safely stopped and stop it, or find a service that hasn't started, start it, and wait 5 seconds before stopping it. WMI Event Viewer appears, notifying you of the event. As shown in the WMI Event Viewer, this event is an instance of __InstanceModificationEvent.

The query in the ServiceStoppedEvent filter uses no timers. The two other example filters do.

Absolute events occur only once, at a particular date and time. If you set the EventDateTime property of the AbsTimer timer (created in Creating an Event Timer Instance) to a future date and then register the TimerEvent consumer (created in Creating an Event Consumer Instance) and the AbsTimerFilter filter (created in Creating an Event Filter Instance), WMI Event Viewer will show the timer event when it is generated at the set date.

Interval events occur at regularly occurring intervals. If you register the TimerEvent consumer and the IntervalTimerFilter filter (created in Creating an Event Filter Instance), WMI Event Viewer shows the timer event generated every five seconds.

See Also

WMI Event Registration Tool Functions, __FilterToConsumerBinding in the Windows Management Instrumentation (WMI) section of the Platform SDK


WMI Event Viewer

WMI Event Viewer is a permanent event consumer that allows users to sort and view the details of events received. As events are generated in WMI by Windows Management or by event providers, event objects are forwarded to any consumers registered for these types of events. You can register WMI Event Viewer for any event filters, so you can view only incoming events that match the filters.

With WMI Event Viewer, you can:

  • View Windows Management-generated events and event information, such as the event's date and time, class, point of origin, and a description.
  • View event instance properties.
  • Start the WMI Event Registration Tool.
  • Clear the display.

Note To use WMI Event Viewer in any namespace other than CIMV2, you must first compile it into the new namespace (at the command prompt, enter mofcomp eviewer.mof). Because Eviewer.mof contains the statement #pragma namespace("\\root\\cimv2"), you must edit Eviewer.mof before compiling and replace "cimv2" in the #pragma statement with the name of the new namespace.

You can start WMI Event Viewer manually using the "WMI Event Viewer" shortcut in the WMI Tools program group. However, this is not necessary for WMI Event Viewer to function because, as a permanent event consumer, it will be launched automatically by WMI whenever an event occurs that needs to be forwarded to it. To register WMI Event Viewer for different types of events, use the WMI Event Registration Tool. This tool can be launched either independently by using the shortcut in the WMI Tools program group or from WMI Event Viewer itself by clicking Register.

Note You must install Windows Management and create a repository of classes on the target computer before you use WMI Event Viewer. One of the methods for creating a repository of classes is to compile a MOF file in the directory where the SDK was installed. (Typically, the location would be C:\Program Files\WMI.)

To compile the MOF file, type the following command:

mofcomp <filename.mof>.

For more information, see the mofcomp topic in the Windows Management Instrumentation (WMI) section of the Platform SDK.

The Eviewer.mof file installed in the WMI Tools directory along with WMI Event Viewer contains the classes and instances required to declare and register the WMI Event Viewer Consumer Provider with the WMI event subsystem. This MOF file is compiled automatically when the Windows Management Service is first started, so that the WMI Event Viewer consumer is registered as a permanent event consumer by default. For more information about the required schema for this type of registration, see Registering an Event Consumer Provider in the Windows Management Instrumentation (WMI) section of the Platform SDK.

Note All permanent event consumers, including WMI Event Viewer, require specific distributed COM (DCOM) permissions to launch automatically on a remote computer for a registered event.

To open WMI Event Viewer

  1. On the Start menu, point to Programs, and then click WMI Tools.
  2. Click WMI Event Viewer.

To set the launch permissions for WMI Event Viewer

  1. Run the Dcomcnfg.exe program from the remote computer's system directory.
  2. On the Applications tab of the Distributed COM Configuration Properties dialog box, select WMI Event Viewer and click Properties.
  3. On the Security tab of the WMI Event Viewer Properties dialog box, select the Use custom launch permissions option and click Edit.
  4. In the Registry Value Permissions dialog box, click Add.
  5. When the Add Users and Groups dialog box appears, select Everyone from the list of users and groups.
  6. Click Add and then click OK.


WMI Event Viewer Interface

The WMI Event Viewer interface includes the following columns of event information.

Column | Event information
Sev | The severity of the event. This is a property of the EventViewerConsumer class, which represents the WMI Event Viewer and can be set differently in different instances of this class through the WMI Event Registration Tool.
Time | When the consumer received the event.
Event Class | The class of the received event, for example __InstanceModificationEvent.
Server | The server where the event occurred.
Description | A short description for the event. This is a property of the EventViewerConsumer class and is configured through the WMI Event Registration Tool. You can define separate consumer instances with different descriptions for the various event filters that the consumer is bound to.

With the WMI Event Viewer columns, you can:

  • Reorder the columns by selecting and dragging a column over another column.
  • Adjust the column size.
  • Sort information according to the column heading by clicking the heading.

Whenever an event is received by WMI Event Viewer (which occurs when a generated event matches an event filter for which WMI Event Viewer is registered), a line is added to the List view in WMI Event Viewer's main dialog box, which provides general information for the event.

Note As events are received and displayed in the WMI Event Viewer, the counter at the bottom of the list displays the total number of events received since the viewer was last cleared. To avoid an "Out of Memory" situation, the viewer is limited to holding 1,000 events at a time. If this number is exceeded and the viewer has not been cleared, it will flush out the oldest events to make room for the new ones. This condition is indicated by a comment at the bottom of the list.

The WMI Event Viewer interface includes the following buttons.

Button | Description
 | Register for events starts WMI Event Registration Tool.
 | View properties allows you to get the full details of the selected event. A dialog box containing the Object Viewer is displayed showing the full contents of the event object. Note that many event objects might contain further embedded objects that are related to the event. For example, an __InstanceCreationEvent event will contain an embedded object, which is the instance that triggered this event. To view the embedded objects, click Object in the Value column for the respective property.
 | Clear Viewer clears the display.


Topic Not Found

No matching topic was found. Some possible reasons and remedies are as follows:

  • The file (.chm) that contains the destination topic is not in the expected location.

    Remedy: Rerun the MSDN Library Setup.

  • The file (.chm) that contains the current topic or destination topic is out-of-date and the link is no longer valid.

    Remedy: Install the latest version of the MSDN Library.

  • The MSDN Library CD is not in the CD-ROM drive.

    Remedy: Insert the MSDN Library CD into the CD-ROM drive.