Skip to content

hardware_report.ps1

Corey Watson edited this page Dec 1, 2025 · 1 revision

hardware_report.ps1

Generates a comprehensive hardware inventory report for the local machine.

Overview

This script generates a comprehensive hardware inventory report for the local machine. Collects system information, CPU, memory, storage, GPU, network adapters, and BIOS details. Designed for unattended execution in RMM environments to gather standardized hardware data for asset management and documentation.

Purpose

Generates a comprehensive hardware inventory report for the local machine. Collects system information, CPU, memory, storage, GPU, network adapters, and BIOS details. Designed for unattended execution in RMM environments to gather standardized hardware data for asset management and documentation.

Prerequisites

  • PowerShell 5.1 or later
  • Windows operating system with CIM/WMI support
  • No special permissions required (runs in user context)

Configuration

Required Inputs

All inputs are hardcoded boolean values that control which sections are included:

  • IncludeStorage: $true - Whether to include storage device information in the report
  • IncludeGpu: $true - Whether to include GPU information in the report
  • IncludeNetwork: $true - Whether to include network adapter information in the report
  • IncludeBios: $true - Whether to include BIOS information in the report
  • IncludeMemoryModules: $true - Whether to include individual RAM module details

Data Sources & Priority

  1. Hardcoded values (defined within the script body)
  2. WMI/CIM queries (Win32_ComputerSystem, Win32_Processor, etc.)
  3. Error

Settings

  • Uses CIM/WMI for hardware data collection (Windows native)
  • All output formatted as Key : Value pairs for RMM parsing
  • No external dependencies or modules required
  • Sizes reported in GB with 2 decimal precision

Behavior

  • Script collects hardware information from local system via CIM queries
  • All sections are optional and can be disabled via hardcoded inputs
  • Missing or unavailable hardware components are reported as "N/A"
  • Output is structured for easy capture by RMM agent stdout collection

Security Notes

  • No secrets are printed to the console
  • No sensitive system information exposed beyond standard hardware inventory
  • All data collected is read-only from system WMI providers

Exit Codes

  • 0 = Success
  • 1 = Failure

Example Output

[ INPUT VALIDATION ]
--------------------------------------------------------------
IncludeStorage       : True
IncludeGpu           : True
IncludeNetwork       : True
IncludeBios          : True
IncludeMemoryModules : True

[ SYSTEM INFORMATION ]
--------------------------------------------------------------
Computer Name        : DESKTOP-ABC123
Manufacturer         : Dell Inc.
Model                : OptiPlex 7090
Serial Number        : 1A2B3C4D
Total Memory         : 32.00 GB
Number of Processors : 1

[ CPU INFORMATION ]
--------------------------------------------------------------
Name                 : Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
Cores                : 8
Logical Processors   : 16
Max Clock Speed      : 2904 MHz

[ STORAGE DEVICES ]
--------------------------------------------------------------
Drive C (Windows)    : 476.46 GB Total | 123.45 GB Free | 353.01 GB Used
Drive D (Data)       : 931.51 GB Total | 456.78 GB Free | 474.73 GB Used

[ FINAL STATUS ]
--------------------------------------------------------------
Hardware report generated successfully.

[ SCRIPT COMPLETED ]
--------------------------------------------------------------

Version History

  • 2025-10-31 v1.0.0 - Initial Style A compliant release with comprehensive hardware inventory collection for RMM environments

Links

Clone this wiki locally