Search code examples
windows-xpwmi

WMI Namespaces - Is There An 'Official List'?


I'm (unfortunately) venturing into Windows (XP) scripting and WMI (Windows Management Instrumentation) as I am attempting to write scripts that will configure such things as network adapters, users etc.

Key to this seems to be the so-called WMI 'Namespaces'; once one has the name spaces apparently it's possible to discover classes within the namespace and read/alter data as necessary. (Apologies if I have misunderstood anything about WMI & namespaces).

So the obvious question is, just what WMI namespaces are available? It's fine being able to write a script that lists them but where is the official Microsoft list of namespaces? How on earth are you supposed to know what:

  1. Namespaces official exist?
  2. What classes are under each namespace?
  3. Where do I look for a specific class say for network settings?

Solution

  • 1.Namespaces official exist?

    AFAIK there is not a official list of WMI namespaces, but you can get the list of installed namespaces programmatically.

    2.What classes are under each namespace?

    Again there isn't a official list, but you can get this list connecting to each namespace and then executing this WQL sentence

    select * from meta_class
    

    3.Where do I look for a specific class say for network settings?

    Take a look to the MSDN documentation Windows Management Infrastructure Classes

    If you need more information about the WMI classes and namespaces I will recommend you use a tool like the WMI Delphi Code Creator, this tool allows you to generate code to access the WMI classes, events and methods. Also includes a set of options to search classes related to a specific keyword, execute WQL sentences, get metadata info about any WMI class and so on.