In this document you can find many useful wmi queries and references for all wmi classes avaible.
Wmi queries are build using SQL like query commands:
SELECT something FROM class
or more specific using where
SELECT something FROM class WHERE PropertyName Operator PropertyValue
If you want to select all attributes of a wmi class, you can use the wildcard *
.
For more Win32 Classes you can search this references:
or you can use this powershell command on the destination windows host to get all avaible classes:
Get-WmiObject -List
select * from Win32_Processor
select TotalPhysicalMemory from Win32_ComputerSystem
select Name, AvailableBytes from Win32_PerfRawData_PerfOS_Memory
select DeviceID, Model, Caption from Win32_DiskDrive
select Size from Win32_DiskDrive
select DeviceID, DriveType from Win32_LogicalDisk
select Size, FreeSpace from Win32_LogicalDisk
select Name, PhysicalAdapter, Speed, MACAddress from Win32_NetworkAdapter
select Name, BytesReceivedPersec, BytesSentPersec, BytesTotalPersec, CurrentBandwidth from Win32_PerfFormattedData_Tcpip_NetworkInterface
select Name, BytesReceivedPersec, BytesSentPersec, BytesTotalPersec, CurrentBandwidth from Win32_PerfFormattedData_Tcpip_NetworkAdapter
select SMBIOSAssetTag from Win32_SystemEnclosure
select Manufacturer from Win32_SystemEnclosure
select Model from Win32_SystemEnclosure
select SerialNumber from Win32_SystemEnclosure
select ChassisTypes from Win32_SystemEnclosure
Note: The chassis type field can be used to determine whether it's a mobile device (laptop or tablet) or a desktop. There is a problem sometimes because it is up to the OEM to determine the correct setting, and sometimes they get it wrong. Here are the codes that work most of the time:
8 = Tablet
9 - 14 = Laptop
Everything Else = Desktop or Server
select CSName, Caption, Version from Win32_OperatingSystem
select * from Win32_LocalTime
select * from Win32_Product
select * from Win32-ComputerSystem
select Name from Win32_ComputerSystem
select * from Win32_Process
It's also possible to just monitor one Process with this query:
select * from Win32_Process where ProcessId = <value>
select * from Win32_Service
It's also possible to just monitor one Service with this query:
select * from Win32_Service where Name = <value>
select Caption, DriverName, PortName from Win32_Printer
select * from Win32_PerfRawData_PerfOS_Processor
select * from Win32_PerfRawData_PerfOS_Memory
select * from Win32_PerfRawData_Tcpiip_NetworkInterface