Finding all WMI class names within a WMI namespace with .NET C#
September 12, 2017 Leave a comment
In this post we saw an example of using WMI objects such as ConnectionOptions, ObjectQuery and ManagementObjectSearcher to enumerate all local drives on a computer. Recall the SQL-like query we used:
ObjectQuery objectQuery = new ObjectQuery("SELECT Size, Name FROM Win32_LogicalDisk where DriveType=3");
We’ll now see a technique to list all WMI classes within a WMI namespace. First we get hold of the WMI namespaces:
