WMI (3): Where do I need classes?

Source: Internet
Author: User
ArticleDirectory
    • Class hierarchy
    • Common WMI classes

In the final analysis, Using WMI is the access to WMI classes. How to find a proper class is a key step. I have been worried that I cannot find a proper class or namespace. Do you have such a problem?

Class hierarchy

WMI classes are organized in the namespace and inheritance hierarchy, and are in a tree structure. The root of the namespace is root, and there are more than a dozen namespaces under it. The most common one is Root \ cimv2. The namespace information is stored in the static _ namespace class. to query all namespaces in the current namespace, you can view the instances of the _ namespace class. The namespace queried by powershell on my machine is as follows:

 
PS c: \ Users \ idsswtt> Get-wmiobject-class _ namespace-namespace root |Select namename----SubtasksDefaultBytes

For more details about the namespace, you can write a recursive script to get it, or get it from WMI (2): How to Use the wmi cim studio tool mentioned in WMI.

Common WMI classes

The WMI architecture contains hundreds of classes. We often use only one part. Some of them are used to query instances, while others are used to query schema of classes. In addition to the _ namespace class mentioned above, we also use the _ win32provider class to query which functions are provided in the current system.Program. These two classes are system classes.

In addition, there are two types of WMI classes that we often use: CIM _ * and Win32. The former is the core class and public class of WMI, and is often referred to as the CIM core class and public class. The latter is a Win32 extension class. We query instances in Win32 extension classes. For example, Win32 _Product, win32_logicaldisk, etc.

WMI lookup manual?

Unfortunately, so far. I have not found a useful WMI class lookup manual. However, there is a classification on the Microsoft msdn website. We can query according to this category. The following links are frequently used by me. I hope you can use them here.

WMI reference

Win32 classes

WMI providers

Conclusion

After reading these things, if you still cannot find the class you want, you can only blame Microsoft. I think Microsoft is doing too little for WMI, at least in class queries. Before Microsoft invests more in WMI, we can only rely on experience and search engines to find appropriate classes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.