Skip to content

A tutorial on querying system information from Windows Management Instrumentation (WMI) in .NET.

License

Notifications You must be signed in to change notification settings

BL1NDX3N0N/WMI-Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

WMI Tutorial

A tutorial on querying system information from Windows Management Instrumentation (WMI) in .NET.

Working on a library needing the ability to detect if it is executing on a virtual environment I resorted to using WMI to create my red pill functions. Finding great use out of WMI I have decided to create this simple tutorial for others to reference and learn from.

WMI is capable of returning information about a Windows system and the software that runs on it by refering to a specific namespace, class, and property. For example, the root\CIMV2 namespace contains several classes pertaining to the system's current hardware configuration such as the motherboard, CPU, RAM, NIC (Network Interface Card), storage, etc.. Even specific BIOS and hardware vendor/manufacturer information can be queried from WMI as well. You can find new namespaces and their classes through PowerShell, WMI Code Creator, or online. For a list of classes you will have to do the same as above as if you were looking for a new namespace.

Using

The command structure is [class] [property]. So we will type in and execute win32_processor name which for me returns:

Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz.

You can find more classes and properties with their descriptions under the root\CIMV2 namespace here.

About

A tutorial on querying system information from Windows Management Instrumentation (WMI) in .NET.

Topics

Resources

License

Stars

Watchers

Forks

Languages