I was getting curious to know various classes/tables that can be queried for ManagementObject to read hardware details.
e.g.
ManagementObjectSearcher adapters =
new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter");
i.e.
1. Win32_NetworkAdapter
2. Win32_LogicalDisk
3. Win32_Service
Where can I find whole list of such tables.
You could select appropriate tables from the following list: http://msdn.microsoft.com/en-us/library/aa389273(v=vs.85).aspx
You could 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"]);
Microsoft's WMI Code Creator is handy for this, its a utility that lists all WMI classes in a searchable fashion, it will generate VBScript code you can run immediately to see whats actually returned and you can then use it to spit out C#/VB.Net code snippets.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With