Devices with Specific Performance Monitor

Devices with Specific Performance Monitor

This query used to detect the devices that has a specific Performance monitor.

SELECT DISTINCT Device.nDeviceID FROM Device
LEFT OUTER JOIN PivotStatisticalMonitorTypeToDevice ON PivotStatisticalMonitorTypeToDevice.nDeviceID = Device.nDeviceID
LEFT OUTER JOIN StatisticalMonitorType ON StatisticalMonitorType.nStatisticalMonitorTypeID = PivotStatisticalMonitorTypeToDevice.nStatisticalMonitorTypeID
WHERE Device.bRemoved = 0 AND StatisticalMonitorType.sStatisticalMonitorTypeName LIKE N'%cpu%'
Note:
You should replace cpu in LIKE N'%cpu%'with the required Performance monitor name.