Hardware Failure Audit

Detect Hardware or Drivers Malfunctioning

Detect if there are hardware or driver malfunctions happening in your environment with the report below. This report provides an overview of all assets that have an error code or warning status on one of the following components scanned via WMI:

  • Power supply
  • Thermal state
  • Battery
  • CPU
  • GPU driver
  • HDD SMART status
  • HDD volumes
  • Monitor
  • Infrared device
  • Keyboard
  • Parallel port
  • PCMCIA controller
  • Printer
  • Scsi controller
  • Serial port
  • Tape drive

We have bundled the most important information in our hardware failure prevention blog.

Hardware Failure Query

Select Top 1000000 tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.Username,
  tblAssets.Userdomain,
  Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
  tblAssets.IPAddress,
  tsysIPLocations.IPLocation,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  tsysOS.OSname As OS,
  tblAssets.SP,
  tcomputer.PowerSupplyState,
  tcomputer.ThermalState,
  tbattery.Availability As BatteryAvailability,
  tbattery.BatteryStatus,
  tProcessor.DeviceID As CPUID,
  tProcessor.Availability As CPUAvailability,
  tVideoController.Caption As VideoDriverName,
  tVideoController.Availability As VideoDriverAvailability,
  tfloppy.Model As HDModel,
  tfloppy.Status As HDStatus,
  tTblVolume.Name As VolumeName,
  tTblVolume.ErrorCleared As VolumeErrorCleared,
  tTblVolume.ErrorDescription As VolumeErrorDescription,
  tTblVolume.ErrorMethodology As VolumeErrorMethodology,
  tmonitor.PNPDeviceID,
  tmonitor.Availability As MonitorAvailability,
  tinfrared.Caption As InfraredDevice,
  tinfrared.Availability As InfraredAvailability,
  tinfrared.ConfigManagerErrorCode As InfraredErrorCode,
  tkeyboard.ConfigManagerErrorCode As KeyboardErrorCode,
  tParallelPort.Caption As ParallelPortName,
  tParallelPort.Availability As ParallelPortAvailability,
  tParallelPort.ConfigManagerErrorCode As ParallelPortErrorCode,
  tPCMCIAController.Caption As PCMCIAControllerName,
  tPCMCIAController.ConfigManagerErrorCode As PCMCIAControllerErrorCode,
  tprinters.Caption As PrinterName,
  tprinters.Status As PrinterStatus,
  tScsiController.Caption As ScsiControllerName,
  tScsiController.Availability As ScsiControllerAvailability,
  tSerialPort.DeviceID As SerialPortName,
  tSerialPort.ProviderType As SerialPortProvider,
  tSerialPort.Availability As SerialPortAvailability,
  tTapeDrive.Caption As TapeDriveName,
  tTapeDrive.Availability As TapeDriveAvailability,
Case
When tblErrors.ErrorText Is Not Null Or
tblErrors.ErrorText != '' Then
'Scanning Error: ' + tsysasseterrortypes.ErrorMsg
Else ''
End As ScanningErrors,
  tblAssets.Lastseen,
  tblAssets.Lasttried
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
  Inner Join tsysIPLocations On tsysIPLocations.LocationID =
      tblAssets.LocationID
  Inner Join tblState On tblState.State = tblAssetCustom.State
  Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
  Left Join (Select tblComputersystem.AssetID,
      Case
        When tblComputersystem.PowerSupplyState = 1 Then 'Other'
        When tblComputersystem.PowerSupplyState = 2 Then 'Unknown'
        When tblComputersystem.PowerSupplyState = 3 Then 'Safe'
        When tblComputersystem.PowerSupplyState = 4 Then 'Warning'
        When tblComputersystem.PowerSupplyState = 5 Then 'Critical'
        When tblComputersystem.PowerSupplyState = 6 Then 'Nonrecoverable'
      End As PowerSupplyState,
      Case
        When tblComputersystem.ThermalState = 1 Then 'Other'
        When tblComputersystem.ThermalState = 2 Then 'Unknown'
        When tblComputersystem.ThermalState = 3 Then 'Safe'
        When tblComputersystem.ThermalState = 4 Then 'Warning'
        When tblComputersystem.ThermalState = 5 Then 'Critical'
        When tblComputersystem.ThermalState = 6 Then 'Nonrecoverable'
      End As ThermalState
    From tblComputersystem
    Where (tblComputersystem.PowerSupplyState <> 3) Or
      (tblComputersystem.ThermalState <> 3)) As tcomputer On tcomputer.AssetID =
      tblAssets.AssetID
  Left Join (Select tblDesktopMonitor.AssetID,
      tblDesktopMonitor.PNPDeviceID,
      Case
        When tblDesktopMonitor.Availability = 1 Then 'Other'
        When tblDesktopMonitor.Availability = 2 Then 'Unknown'
        When tblDesktopMonitor.Availability = 3 Then 'Running or Full Power'
        When tblDesktopMonitor.Availability = 4 Then 'Warning'
        When tblDesktopMonitor.Availability = 5 Then 'In Test'
        When tblDesktopMonitor.Availability = 6 Then 'Not Applicable'
        When tblDesktopMonitor.Availability = 7 Then 'Power Off'
        When tblDesktopMonitor.Availability = 8 Then 'Off Line'
        When tblDesktopMonitor.Availability = 9 Then 'Off Duty'
        When tblDesktopMonitor.Availability = 10 Then 'Degraded'
        When tblDesktopMonitor.Availability = 11 Then 'Not Installed'
        When tblDesktopMonitor.Availability = 12 Then 'Install Error'
        When tblDesktopMonitor.Availability = 13 Then 'Power Save - Unknown'
        When tblDesktopMonitor.Availability = 14 Then
          'Power Save - Low Power Mode'
        When tblDesktopMonitor.Availability = 15 Then 'Power Save - Standby'
        When tblDesktopMonitor.Availability = 16 Then 'Power Cycle'
        When tblDesktopMonitor.Availability = 17 Then 'Power Save - Warning'
      End As Availability
    From tblDesktopMonitor
    Where tblDesktopMonitor.Availability Not In (2, 3, 7, 8, 9, 13, 14,
      15)) As tmonitor On tmonitor.AssetID = tblAssets.AssetID
  Left Join (Select tblBattery.AssetID,
      Case
        When tblBattery.Availability = 1 Then 'Other'
        When tblBattery.Availability = 2 Then 'Unknown'
        When tblBattery.Availability = 3 Then 'Running or Full Power'
        When tblBattery.Availability = 4 Then 'Warning'
        When tblBattery.Availability = 5 Then 'In Test'
        When tblBattery.Availability = 6 Then 'Not Applicable'
        When tblBattery.Availability = 7 Then 'Power Off'
        When tblBattery.Availability = 8 Then 'Off Line'
        When tblBattery.Availability = 9 Then 'Off Duty'
        When tblBattery.Availability = 10 Then 'Degraded'
        When tblBattery.Availability = 11 Then 'Not Installed'
        When tblBattery.Availability = 12 Then 'Install Error'
        When tblBattery.Availability = 13 Then 'Power Save - Unknown'
        When tblBattery.Availability = 14 Then 'Power Save - Low Power Mode'
        When tblBattery.Availability = 15 Then 'Power Save - Standby'
        When tblBattery.Availability = 16 Then 'Power Cycle'
        When tblBattery.Availability = 17 Then 'Power Save - Warning'
      End As Availability,
      Case
        When tblBattery.BatteryStatus = 1 Then 'The battery is discharging.'
        When tblBattery.BatteryStatus = 2 Then
          'The system has access to AC so no battery is being discharged. However, the battery is not necessarily charging.'
        When tblBattery.BatteryStatus = 3 Then 'Fully Charged'
        When tblBattery.BatteryStatus = 4 Then 'Low'
        When tblBattery.BatteryStatus = 5 Then 'Critical'
        When tblBattery.BatteryStatus = 6 Then 'Charging'
        When tblBattery.BatteryStatus = 7 Then 'Charging and High'
        When tblBattery.BatteryStatus = 8 Then 'Charging and Low'
        When tblBattery.BatteryStatus = 9 Then 'Charging and Critical'
        When tblBattery.BatteryStatus = 10 Then 'Undefined'
        When tblBattery.BatteryStatus = 11 Then 'Partially Charged'
      End As BatteryStatus
    From tblBattery
    Where (tblBattery.Availability Not In (2, 3, 7, 8, 9, 13, 14, 15)) Or
      (tblBattery.BatteryStatus In (5, 9, 10))) As tbattery On
      tbattery.AssetID = tblAssets.AssetID
  Left Join (Select tblFloppy.AssetID,
      tblFloppy.Model,
      tblFloppy.Status
    From tblFloppy
    Where tblFloppy.Status Not Like 'OK') As tfloppy On tfloppy.AssetID =
      tblAssets.AssetID
  Left Join (Select Tblinfrareddevice.AssetID,
      Tblinfrareddevice.Caption,
      Case
        When Tblinfrareddevice.Availability = 1 Then 'Other'
        When Tblinfrareddevice.Availability = 2 Then 'Unknown'
        When Tblinfrareddevice.Availability = 3 Then 'Running or Full Power'
        When Tblinfrareddevice.Availability = 4 Then 'Warning'
        When Tblinfrareddevice.Availability = 5 Then 'In Test'
        When Tblinfrareddevice.Availability = 6 Then 'Not Applicable'
        When Tblinfrareddevice.Availability = 7 Then 'Power Off'
        When Tblinfrareddevice.Availability = 8 Then 'Off Line'
        When Tblinfrareddevice.Availability = 9 Then 'Off Duty'
        When Tblinfrareddevice.Availability = 10 Then 'Degraded'
        When Tblinfrareddevice.Availability = 11 Then 'Not Installed'
        When Tblinfrareddevice.Availability = 12 Then 'Install Error'
        When Tblinfrareddevice.Availability = 13 Then 'Power Save - Unknown'
        When Tblinfrareddevice.Availability = 14 Then
          'Power Save - Low Power Mode'
        When Tblinfrareddevice.Availability = 15 Then 'Power Save - Standby'
        When Tblinfrareddevice.Availability = 16 Then 'Power Cycle'
        When Tblinfrareddevice.Availability = 17 Then 'Power Save - Warning'
      End As Availability,
      Case
        When Tblinfrareddevice.ConfigManagerErrorCode = 0 Then
          'Device is working properly'
        When Tblinfrareddevice.ConfigManagerErrorCode = 1 Then
          'Device is not configured correctly.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 2 Then
          'Windows cannot load the driver for this device.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 3 Then
          'Driver for this device might be corrupted, or the system may be low on memory or other resources.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 4 Then
          'Device is not working properly. One of its drivers or the registry might be corrupted.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 5 Then
          'Driver for the device requires a resource that Windows cannot manage.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 6 Then
          'Boot configuration for the device conflicts with other devices.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 7 Then 'Cannot filter.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 8 Then
          'Driver loader for the device is missing.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 9 Then
          'Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 10 Then
          'Device cannot start.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 11 Then 'Device failed.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 12 Then
          'Device cannot find enough free resources to use.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 13 Then
          'Windows cannot verify the device resource.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 14 Then
          'Device cannot work properly until the computer is restarted.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 15 Then
          'Device is not working properly due to a possible re-enumeration problem.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 16 Then
          'Windows cannot identify all of the resources that the device uses.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 17 Then
          'Device is requesting an unknown resource type.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 18 Then
          'Device drivers must be reinstalled.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 19 Then
          'Failure using the VxD loader.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 20 Then
          'Registry might be corrupted.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 21 Then
          'System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 22 Then
          'Device is disabled.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 23 Then
          'System failure. If changing the device driver is ineffective, see the hardware documentation.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 24 Then
          'Device is not present, not working properly, or does not have all of its drivers installed.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 25 Then
          'Windows is still setting up the device.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 26 Then
          'Windows is still setting up the device.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 27 Then
          'Device does not have valid log configuration.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 28 Then
          'Device drivers are not installed.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 29 Then
          'Device is disabled. The device firmware did not provide the required resources.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 30 Then
          'Device is using an IRQ resource that another device is using.'
        When Tblinfrareddevice.ConfigManagerErrorCode = 31 Then
          'Device is not working properly. Windows cannot load the required device drivers.'
      End As ConfigManagerErrorCode
    From Tblinfrareddevice
    Where (Tblinfrareddevice.Availability Not In (2, 3, 7, 8, 9, 13, 14, 15)) Or
      (Tblinfrareddevice.ConfigManagerErrorCode Not In (0))) As tinfrared On
      tinfrared.AssetID = tblAssets.AssetID
  Left Join (Select Tblkeyboard.AssetID,
      Case
        When Tblkeyboard.ConfigManagerErrorCode = 0 Then
          'Device is working properly'
        When Tblkeyboard.ConfigManagerErrorCode = 1 Then
          'Device is not configured correctly.'
        When Tblkeyboard.ConfigManagerErrorCode = 2 Then
          'Windows cannot load the driver for this device.'
        When Tblkeyboard.ConfigManagerErrorCode = 3 Then
          'Driver for this device might be corrupted, or the system may be low on memory or other resources.'
        When Tblkeyboard.ConfigManagerErrorCode = 4 Then
          'Device is not working properly. One of its drivers or the registry might be corrupted.'
        When Tblkeyboard.ConfigManagerErrorCode = 5 Then
          'Driver for the device requires a resource that Windows cannot manage.'
        When Tblkeyboard.ConfigManagerErrorCode = 6 Then
          'Boot configuration for the device conflicts with other devices.'
        When Tblkeyboard.ConfigManagerErrorCode = 7 Then 'Cannot filter.'
        When Tblkeyboard.ConfigManagerErrorCode = 8 Then
          'Driver loader for the device is missing.'
        When Tblkeyboard.ConfigManagerErrorCode = 9 Then
          'Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.'
        When Tblkeyboard.ConfigManagerErrorCode = 10 Then 'Device cannot start.'
        When Tblkeyboard.ConfigManagerErrorCode = 11 Then 'Device failed.'
        When Tblkeyboard.ConfigManagerErrorCode = 12 Then
          'Device cannot find enough free resources to use.'
        When Tblkeyboard.ConfigManagerErrorCode = 13 Then
          'Windows cannot verify the device resource.'
        When Tblkeyboard.ConfigManagerErrorCode = 14 Then
          'Device cannot work properly until the computer is restarted.'
        When Tblkeyboard.ConfigManagerErrorCode = 15 Then
          'Device is not working properly due to a possible re-enumeration problem.'
        When Tblkeyboard.ConfigManagerErrorCode = 16 Then
          'Windows cannot identify all of the resources that the device uses.'
        When Tblkeyboard.ConfigManagerErrorCode = 17 Then
          'Device is requesting an unknown resource type.'
        When Tblkeyboard.ConfigManagerErrorCode = 18 Then
          'Device drivers must be reinstalled.'
        When Tblkeyboard.ConfigManagerErrorCode = 19 Then
          'Failure using the VxD loader.'
        When Tblkeyboard.ConfigManagerErrorCode = 20 Then
          'Registry might be corrupted.'
        When Tblkeyboard.ConfigManagerErrorCode = 21 Then
          'System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.'
        When Tblkeyboard.ConfigManagerErrorCode = 22 Then 'Device is disabled.'
        When Tblkeyboard.ConfigManagerErrorCode = 23 Then
          'System failure. If changing the device driver is ineffective, see the hardware documentation.'
        When Tblkeyboard.ConfigManagerErrorCode = 24 Then
          'Device is not present, not working properly, or does not have all of its drivers installed.'
        When Tblkeyboard.ConfigManagerErrorCode = 25 Then
          'Windows is still setting up the device.'
        When Tblkeyboard.ConfigManagerErrorCode = 26 Then
          'Windows is still setting up the device.'
        When Tblkeyboard.ConfigManagerErrorCode = 27 Then
          'Device does not have valid log configuration.'
        When Tblkeyboard.ConfigManagerErrorCode = 28 Then
          'Device drivers are not installed.'
        When Tblkeyboard.ConfigManagerErrorCode = 29 Then
          'Device is disabled. The device firmware did not provide the required resources.'
        When Tblkeyboard.ConfigManagerErrorCode = 30 Then
          'Device is using an IRQ resource that another device is using.'
        When Tblkeyboard.ConfigManagerErrorCode = 31 Then
          'Device is not working properly. Windows cannot load the required device drivers.'
      End As ConfigManagerErrorCode
    From Tblkeyboard
    Where Tblkeyboard.ConfigManagerErrorCode Not In (0)) As tkeyboard On
      tkeyboard.AssetID = tblAssets.AssetID
  Left Join (Select tblParallelPort.AssetID,
      tblParallelPort.Caption,
      Case
        When tblParallelPort.Availability = 1 Then 'Other'
        When tblParallelPort.Availability = 2 Then 'Unknown'
        When tblParallelPort.Availability = 3 Then 'Running or Full Power'
        When tblParallelPort.Availability = 4 Then 'Warning'
        When tblParallelPort.Availability = 5 Then 'In Test'
        When tblParallelPort.Availability = 6 Then 'Not Applicable'
        When tblParallelPort.Availability = 7 Then 'Power Off'
        When tblParallelPort.Availability = 8 Then 'Off Line'
        When tblParallelPort.Availability = 9 Then 'Off Duty'
        When tblParallelPort.Availability = 10 Then 'Degraded'
        When tblParallelPort.Availability = 11 Then 'Not Installed'
        When tblParallelPort.Availability = 12 Then 'Install Error'
        When tblParallelPort.Availability = 13 Then 'Power Save - Unknown'
        When tblParallelPort.Availability = 14 Then
          'Power Save - Low Power Mode'
        When tblParallelPort.Availability = 15 Then 'Power Save - Standby'
        When tblParallelPort.Availability = 16 Then 'Power Cycle'
        When tblParallelPort.Availability = 17 Then 'Power Save - Warning'
      End As Availability,
      Case
        When tblParallelPort.ConfigManagerErrorCode = 0 Then
          'Device is working properly'
        When tblParallelPort.ConfigManagerErrorCode = 1 Then
          'Device is not configured correctly.'
        When tblParallelPort.ConfigManagerErrorCode = 2 Then
          'Windows cannot load the driver for this device.'
        When tblParallelPort.ConfigManagerErrorCode = 3 Then
          'Driver for this device might be corrupted, or the system may be low on memory or other resources.'
        When tblParallelPort.ConfigManagerErrorCode = 4 Then
          'Device is not working properly. One of its drivers or the registry might be corrupted.'
        When tblParallelPort.ConfigManagerErrorCode = 5 Then
          'Driver for the device requires a resource that Windows cannot manage.'
        When tblParallelPort.ConfigManagerErrorCode = 6 Then
          'Boot configuration for the device conflicts with other devices.'
        When tblParallelPort.ConfigManagerErrorCode = 7 Then 'Cannot filter.'
        When tblParallelPort.ConfigManagerErrorCode = 8 Then
          'Driver loader for the device is missing.'
        When tblParallelPort.ConfigManagerErrorCode = 9 Then
          'Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.'
        When tblParallelPort.ConfigManagerErrorCode = 10 Then
          'Device cannot start.'
        When tblParallelPort.ConfigManagerErrorCode = 11 Then 'Device failed.'
        When tblParallelPort.ConfigManagerErrorCode = 12 Then
          'Device cannot find enough free resources to use.'
        When tblParallelPort.ConfigManagerErrorCode = 13 Then
          'Windows cannot verify the device resource.'
        When tblParallelPort.ConfigManagerErrorCode = 14 Then
          'Device cannot work properly until the computer is restarted.'
        When tblParallelPort.ConfigManagerErrorCode = 15 Then
          'Device is not working properly due to a possible re-enumeration problem.'
        When tblParallelPort.ConfigManagerErrorCode = 16 Then
          'Windows cannot identify all of the resources that the device uses.'
        When tblParallelPort.ConfigManagerErrorCode = 17 Then
          'Device is requesting an unknown resource type.'
        When tblParallelPort.ConfigManagerErrorCode = 18 Then
          'Device drivers must be reinstalled.'
        When tblParallelPort.ConfigManagerErrorCode = 19 Then
          'Failure using the VxD loader.'
        When tblParallelPort.ConfigManagerErrorCode = 20 Then
          'Registry might be corrupted.'
        When tblParallelPort.ConfigManagerErrorCode = 21 Then
          'System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.'
        When tblParallelPort.ConfigManagerErrorCode = 22 Then
          'Device is disabled.'
        When tblParallelPort.ConfigManagerErrorCode = 23 Then
          'System failure. If changing the device driver is ineffective, see the hardware documentation.'
        When tblParallelPort.ConfigManagerErrorCode = 24 Then
          'Device is not present, not working properly, or does not have all of its drivers installed.'
        When tblParallelPort.ConfigManagerErrorCode = 25 Then
          'Windows is still setting up the device.'
        When tblParallelPort.ConfigManagerErrorCode = 26 Then
          'Windows is still setting up the device.'
        When tblParallelPort.ConfigManagerErrorCode = 27 Then
          'Device does not have valid log configuration.'
        When tblParallelPort.ConfigManagerErrorCode = 28 Then
          'Device drivers are not installed.'
        When tblParallelPort.ConfigManagerErrorCode = 29 Then
          'Device is disabled. The device firmware did not provide the required resources.'
        When tblParallelPort.ConfigManagerErrorCode = 30 Then
          'Device is using an IRQ resource that another device is using.'
        When tblParallelPort.ConfigManagerErrorCode = 31 Then
          'Device is not working properly. Windows cannot load the required device drivers.'
      End As ConfigManagerErrorCode
    From tblParallelPort
    Where (tblParallelPort.Availability Not In (2, 3, 7, 8, 9, 13, 14, 15)) Or
      (tblParallelPort.ConfigManagerErrorCode Not In (0))) As tParallelPort On
      tParallelPort.AssetID = tblAssets.AssetID
  Left Join (Select TblPCMCIAController.AssetID,
      TblPCMCIAController.Caption,
      Case
        When TblPCMCIAController.ConfigManagerErrorCode = 0 Then
          'Device is working properly'
        When TblPCMCIAController.ConfigManagerErrorCode = 1 Then
          'Device is not configured correctly.'
        When TblPCMCIAController.ConfigManagerErrorCode = 2 Then
          'Windows cannot load the driver for this device.'
        When TblPCMCIAController.ConfigManagerErrorCode = 3 Then
          'Driver for this device might be corrupted, or the system may be low on memory or other resources.'
        When TblPCMCIAController.ConfigManagerErrorCode = 4 Then
          'Device is not working properly. One of its drivers or the registry might be corrupted.'
        When TblPCMCIAController.ConfigManagerErrorCode = 5 Then
          'Driver for the device requires a resource that Windows cannot manage.'
        When TblPCMCIAController.ConfigManagerErrorCode = 6 Then
          'Boot configuration for the device conflicts with other devices.'
        When TblPCMCIAController.ConfigManagerErrorCode = 7 Then
          'Cannot filter.'
        When TblPCMCIAController.ConfigManagerErrorCode = 8 Then
          'Driver loader for the device is missing.'
        When TblPCMCIAController.ConfigManagerErrorCode = 9 Then
          'Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.'
        When TblPCMCIAController.ConfigManagerErrorCode = 10 Then
          'Device cannot start.'
        When TblPCMCIAController.ConfigManagerErrorCode = 11 Then
          'Device failed.'
        When TblPCMCIAController.ConfigManagerErrorCode = 12 Then
          'Device cannot find enough free resources to use.'
        When TblPCMCIAController.ConfigManagerErrorCode = 13 Then
          'Windows cannot verify the device resource.'
        When TblPCMCIAController.ConfigManagerErrorCode = 14 Then
          'Device cannot work properly until the computer is restarted.'
        When TblPCMCIAController.ConfigManagerErrorCode = 15 Then
          'Device is not working properly due to a possible re-enumeration problem.'
        When TblPCMCIAController.ConfigManagerErrorCode = 16 Then
          'Windows cannot identify all of the resources that the device uses.'
        When TblPCMCIAController.ConfigManagerErrorCode = 17 Then
          'Device is requesting an unknown resource type.'
        When TblPCMCIAController.ConfigManagerErrorCode = 18 Then
          'Device drivers must be reinstalled.'
        When TblPCMCIAController.ConfigManagerErrorCode = 19 Then
          'Failure using the VxD loader.'
        When TblPCMCIAController.ConfigManagerErrorCode = 20 Then
          'Registry might be corrupted.'
        When TblPCMCIAController.ConfigManagerErrorCode = 21 Then
          'System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.'
        When TblPCMCIAController.ConfigManagerErrorCode = 22 Then
          'Device is disabled.'
        When TblPCMCIAController.ConfigManagerErrorCode = 23 Then
          'System failure. If changing the device driver is ineffective, see the hardware documentation.'
        When TblPCMCIAController.ConfigManagerErrorCode = 24 Then
          'Device is not present, not working properly, or does not have all of its drivers installed.'
        When TblPCMCIAController.ConfigManagerErrorCode = 25 Then
          'Windows is still setting up the device.'
        When TblPCMCIAController.ConfigManagerErrorCode = 26 Then
          'Windows is still setting up the device.'
        When TblPCMCIAController.ConfigManagerErrorCode = 27 Then
          'Device does not have valid log configuration.'
        When TblPCMCIAController.ConfigManagerErrorCode = 28 Then
          'Device drivers are not installed.'
        When TblPCMCIAController.ConfigManagerErrorCode = 29 Then
          'Device is disabled. The device firmware did not provide the required resources.'
        When TblPCMCIAController.ConfigManagerErrorCode = 30 Then
          'Device is using an IRQ resource that another device is using.'
        When TblPCMCIAController.ConfigManagerErrorCode = 31 Then
          'Device is not working properly. Windows cannot load the required device drivers.'
      End As ConfigManagerErrorCode
    From TblPCMCIAController
    Where TblPCMCIAController.ConfigManagerErrorCode Not In (0)) As
  tPCMCIAController On tPCMCIAController.AssetID = tblAssets.AssetID
  Left Join (Select tblPrinters.AssetID,
      tblPrinters.Caption,
      tblPrinters.Status
    From tblPrinters
    Where tblPrinters.Status Not In ('Unknown', 'OK')) As tprinters On
      tprinters.AssetID = tblAssets.AssetID
  Left Join (Select tblProcessor.AssetID,
      tblProcessor.DeviceID,
      Case
        When tblProcessor.CpuStatus = 0 Then 'Other'
        When tblProcessor.CpuStatus = 1 Then 'CPU Enabled'
        When tblProcessor.CpuStatus = 2 Then
          'CPU Disabled by User via BIOS Setup'
        When tblProcessor.CpuStatus = 3 Then 'CPU Disabled by BIOS (POST Error)'
        When tblProcessor.CpuStatus = 4 Then 'CPU Is Idle'
        When tblProcessor.CpuStatus = 5 Then 'Reserved'
        When tblProcessor.CpuStatus = 6 Then 'Reserved'
        When tblProcessor.CpuStatus = 7 Then 'Other'
      End As Availability
    From tblProcessor
    Where tblProcessor.CpuStatus <> 1) As tProcessor On tProcessor.AssetID =
      tblAssets.AssetID
  Left Join (Select TblScsiController.AssetID,
      TblScsiController.Caption,
      Case
        When TblScsiController.Availability = 1 Then 'Other'
        When TblScsiController.Availability = 2 Then 'Unknown'
        When TblScsiController.Availability = 3 Then 'Running or Full Power'
        When TblScsiController.Availability = 4 Then 'Warning'
        When TblScsiController.Availability = 5 Then 'In Test'
        When TblScsiController.Availability = 6 Then 'Not Applicable'
        When TblScsiController.Availability = 7 Then 'Power Off'
        When TblScsiController.Availability = 8 Then 'Off Line'
        When TblScsiController.Availability = 9 Then 'Off Duty'
        When TblScsiController.Availability = 10 Then 'Degraded'
        When TblScsiController.Availability = 11 Then 'Not Installed'
        When TblScsiController.Availability = 12 Then 'Install Error'
        When TblScsiController.Availability = 13 Then 'Power Save - Unknown'
        When TblScsiController.Availability = 14 Then
          'Power Save - Low Power Mode'
        When TblScsiController.Availability = 15 Then 'Power Save - Standby'
        When TblScsiController.Availability = 16 Then 'Power Cycle'
        When TblScsiController.Availability = 17 Then 'Power Save - Warning'
      End As Availability
    From TblScsiController
    Where TblScsiController.Availability Not In (2, 3, 7, 8, 9, 13, 14,
      15)) As tScsiController On tScsiController.AssetID = tblAssets.AssetID
  Left Join (Select TblSerialPort.AssetID,
      TblSerialPort.DeviceID,
      TblSerialPort.ProviderType,
      Case
        When TblSerialPort.Availability = 1 Then 'Other'
        When TblSerialPort.Availability = 2 Then 'Unknown'
        When TblSerialPort.Availability = 3 Then 'Running or Full Power'
        When TblSerialPort.Availability = 4 Then 'Warning'
        When TblSerialPort.Availability = 5 Then 'In Test'
        When TblSerialPort.Availability = 6 Then 'Not Applicable'
        When TblSerialPort.Availability = 7 Then 'Power Off'
        When TblSerialPort.Availability = 8 Then 'Off Line'
        When TblSerialPort.Availability = 9 Then 'Off Duty'
        When TblSerialPort.Availability = 10 Then 'Degraded'
        When TblSerialPort.Availability = 11 Then 'Not Installed'
        When TblSerialPort.Availability = 12 Then 'Install Error'
        When TblSerialPort.Availability = 13 Then 'Power Save - Unknown'
        When TblSerialPort.Availability = 14 Then 'Power Save - Low Power Mode'
        When TblSerialPort.Availability = 15 Then 'Power Save - Standby'
        When TblSerialPort.Availability = 16 Then 'Power Cycle'
        When TblSerialPort.Availability = 17 Then 'Power Save - Warning'
      End As Availability
    From TblSerialPort
    Where TblSerialPort.Availability Not In (2, 3, 7, 8, 9, 13, 14,
      15)) As tSerialPort On tSerialPort.AssetID = tblAssets.AssetID
  Left Join (Select TblTapeDrive.AssetID,
      TblTapeDrive.Caption,
      Case
        When TblTapeDrive.Availability = 1 Then 'Other'
        When TblTapeDrive.Availability = 2 Then 'Unknown'
        When TblTapeDrive.Availability = 3 Then 'Running or Full Power'
        When TblTapeDrive.Availability = 4 Then 'Warning'
        When TblTapeDrive.Availability = 5 Then 'In Test'
        When TblTapeDrive.Availability = 6 Then 'Not Applicable'
        When TblTapeDrive.Availability = 7 Then 'Power Off'
        When TblTapeDrive.Availability = 8 Then 'Off Line'
        When TblTapeDrive.Availability = 9 Then 'Off Duty'
        When TblTapeDrive.Availability = 10 Then 'Degraded'
        When TblTapeDrive.Availability = 11 Then 'Not Installed'
        When TblTapeDrive.Availability = 12 Then 'Install Error'
        When TblTapeDrive.Availability = 13 Then 'Power Save - Unknown'
        When TblTapeDrive.Availability = 14 Then 'Power Save - Low Power Mode'
        When TblTapeDrive.Availability = 15 Then 'Power Save - Standby'
        When TblTapeDrive.Availability = 16 Then 'Power Cycle'
        When TblTapeDrive.Availability = 17 Then 'Power Save - Warning'
      End As Availability
    From TblTapeDrive
    Where TblTapeDrive.Availability Not In (2, 3, 7, 8, 9, 13, 14,
      15)) As tTapeDrive On tTapeDrive.AssetID = tblAssets.AssetID
  Left Join (Select TblVideoController.AssetID,
      TblVideoController.Caption,
      Case
        When TblVideoController.Availability = 1 Then 'Other'
        When TblVideoController.Availability = 2 Then 'Unknown'
        When TblVideoController.Availability = 3 Then 'Running or Full Power'
        When TblVideoController.Availability = 4 Then 'Warning'
        When TblVideoController.Availability = 5 Then 'In Test'
        When TblVideoController.Availability = 6 Then 'Not Applicable'
        When TblVideoController.Availability = 7 Then 'Power Off'
        When TblVideoController.Availability = 8 Then 'Off Line'
        When TblVideoController.Availability = 9 Then 'Off Duty'
        When TblVideoController.Availability = 10 Then 'Degraded'
        When TblVideoController.Availability = 11 Then 'Not Installed'
        When TblVideoController.Availability = 12 Then 'Install Error'
        When TblVideoController.Availability = 13 Then 'Power Save - Unknown'
        When TblVideoController.Availability = 14 Then
          'Power Save - Low Power Mode'
        When TblVideoController.Availability = 15 Then 'Power Save - Standby'
        When TblVideoController.Availability = 16 Then 'Power Cycle'
        When TblVideoController.Availability = 17 Then 'Power Save - Warning'
      End As Availability
    From TblVideoController
    Where TblVideoController.Availability Not In (2, 3, 7, 8, 9, 13, 14,
      15)) As tVideoController On tVideoController.AssetID = tblAssets.AssetID
  Left Join (Select TblVolume.AssetID,
      TblVolume.Name,
      Case
        When TblVolume.ErrorCleared = 1 Then 'Error is cleared'
        When TblVolume.ErrorCleared = 0 Then 'Error is not cleared'
      End As ErrorCleared,
      TblVolume.ErrorDescription,
      TblVolume.ErrorMethodology
    From TblVolume
    Where (TblVolume.ErrorCleared Is Not Null) Or
      (TblVolume.ErrorDescription Is Not Null) Or
      (TblVolume.ErrorMethodology Is Not Null)) As tTblVolume On
      tTblVolume.AssetID = tblAssets.AssetID
	  Left Join (Select Distinct Top 1000000 tblErrors.AssetID As ID,
Max(tblErrors.Teller) As ErrorID
From tblErrors
Group By tblErrors.AssetID) As ScanningError On tblAssets.AssetID =
ScanningError.ID
Left Join tblErrors On ScanningError.ErrorID = tblErrors.Teller
Left Join tsysasseterrortypes On tsysasseterrortypes.Errortype =
tblErrors.ErrorType
Where (tcomputer.PowerSupplyState Is Not Null Or tcomputer.ThermalState Is Not
    Null Or tmonitor.PNPDeviceID Is Not Null Or tmonitor.Availability Is Not
    Null Or tbattery.Availability Is Not Null Or tbattery.BatteryStatus Is Not
    Null Or tfloppy.Model Is Not Null Or tfloppy.Status Is Not Null Or
    tinfrared.Caption Is Not Null Or tinfrared.Availability Is Not Null Or
    tinfrared.ConfigManagerErrorCode Is Not Null Or
    tkeyboard.ConfigManagerErrorCode Is Not Null Or
    tParallelPort.Caption Is Not Null Or tParallelPort.Availability Is Not Null
    Or tParallelPort.ConfigManagerErrorCode Is Not Null Or
    tPCMCIAController.Caption Is Not Null Or
    tPCMCIAController.ConfigManagerErrorCode Is Not Null Or
    tprinters.Caption Is Not Null Or tprinters.Status Is Not Null Or
    tProcessor.DeviceID Is Not Null Or tProcessor.Availability Is Not Null Or
    tScsiController.Caption Is Not Null Or tScsiController.Availability Is Not
    Null Or tSerialPort.DeviceID Is Not Null Or tSerialPort.ProviderType Is Not
    Null Or tSerialPort.Availability Is Not Null Or
    tTapeDrive.Caption Is Not Null Or tTapeDrive.Availability Is Not Null Or
    tVideoController.Caption Is Not Null Or tVideoController.Availability Is Not
    Null Or tTblVolume.Name Is Not Null Or tTblVolume.ErrorCleared Is Not Null
    Or tTblVolume.ErrorDescription Is Not Null Or tTblVolume.ErrorMethodology Is
    Not Null) And tblState.Statename = 'Active'
Order By tblAssets.Domain,
  tblAssets.AssetName

Audit and Take Action in 3 Easy Steps

1. Download & Install Lansweeper

3. Run the Audit & Take Action

Download Lansweeper to Run this Audit

Harness the Power of Reporting