Method

GetWmiNames

ModuleNativeServices
LibraryCore
Action


Where they exist, returns all the namespaces, classes and columns that match the locator strings.


Parameters

Namespace (string): The WMI namespace to match.

Class (string): The WMI class to match within the above WMI namespace.

Column (string): The column name to match within the above WMI Class.

Return values

If nothing matches all three parameters then the instruction will return success but no data. If anything matches then the result set will contain one row for each match on the three locator strings.

  • Namespace (string): A WMI namespace that matched.
  • Class (string): A WMI class within the above WMI namespace that matched.
  • Column (string): A column from the above WMI class that matched
Example

This should match one row on all Windows machines

@result = NativeServices.GetWmiNames(Namespace:"root\\cimv2", Class:"Win32_Processor", Column:"Manufacturer");


Platforms
  • Windows
Notes

The parameters can be wildcard expressions, so this method can dump every namespace, class and column if desired:

@result = NativeServices.GetWmiNames(Namespace:"*", Class:"*", Column:"*");

which would be a big result set with many thousands of rows. Or it could be narrowed down:

@result = NativeServices.GetWmiNames(Namespace:"root\\*", Class:"Win32_P*", Column:"M*");

For all namespaces beginning "root\\", for all the classes in those namespaces starting with "Win32_P", for all the columns in those classes starting with M, return the matching results will be issued as one unique WMI Namespace + class + column row per match in the result set.

Be warned that the last example presented here took 85 seconds to complete and returned 603 rows, so try to be specific if possible.