Hey everyone, Is there any known way of listing the WMI classes and their properties available for a particular system? Im interested in a vbscript approach, but please suggest anything really :)
P.S. Great site.
Hey everyone, Is there any known way of listing the WMI classes and their properties available for a particular system? Im interested in a vbscript approach, but please suggest anything really :)
P.S. Great site.
I believe this is what you want.
A part of this nifty utility allows you to browse namespaces/classes/properties on the local and remote PCs, not to mention generating WMI code in VBScript/C#/VB on the fly. Very useful.
Also, the source code used to create the utility is included in the download, which could provide a reference if you wanted to create your own browser like interface.
This MSDN page walks through enumerating the available classes: How to: List the Classes in a WMI Namespace
for retrieving properties from a class:
ManagementPath l_Path = new ManagementPath(l_className);
ManagementClass l_Class = new ManagementClass(myScope, l_ManagementPath, null);
foreach (PropertyData l_PropertyData in l_Class.Properties)
{
string l_type = l_PropertyData.Type.ToString());
int l_length = Convert.ToInt32(l_PropertyData.Qualifiers["maxlen"].Value);
}