Where can I find all tables used in ManagementObjectSearcher in win32 API
I was curious to know the different classes / tables that can be requested for a ManagementObject to read hardware details.
eg.
ManagementObjectSearcher adapters =
new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter");
i.e.
1. Win32_NetworkAdapter
2. Win32_LogicalDisk
3. Win32_Service
Where can you find a complete list of such tables.
+3
source to share
2 answers
You can select matching tables from the following list: http://msdn.microsoft.com/en-us/library/aa389273(v=vs.85).aspx
You can also get this list programmatically:
ManagementObjectSearcher wmi = new ManagementObjectSearcher
("SELECT * FROM meta_class WHERE __CLASS LIKE 'Win32_%'");
foreach (ManagementObject obj in wmi.Get())
Console.WriteLine(obj["__CLASS"]);
+4
source to share
Microsoft WMI Code Creator is handy for this, its utility which lists all searchable WMI classes will generate VBScript code you can run right away to see what is actually returned and then you can use it to spit out snippets of code C # / VB.Net.
+4
source to share