Execution Flow
No WinRM / PowerShell Remoting required for remote servers — uses DCOM/WMI (port 135 + dynamic ports). SQL instances are discovered via Win32_Service, no SQL connection needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| -ComputerName | String[] | Optional | One or more target servers. Aliases: SqlInstance, ServerName. Pipeline-capable. Default: local computer. |
| -ReportPath | String | Optional | Output directory. Defaults to Get-sqmConfig 'OutputPath'\HardwareReports or %ProgramData%\sqmSQLTool\HardwareReports. |
| -OutputFormat | String | Optional | HTML (default), CSV, TXT, or All. Multiple formats created when All is used. |
| -NoOpen | Switch | Optional | Suppress automatic browser launch for the HTML report. |
| -PassThru | Switch | Optional | Return the full path(s) of created file(s) as strings. |
| -EnableException | Switch | Optional | Throw exceptions instead of using Write-Error. |
Report Sections
| Section | Details |
|---|---|
| Summary cards | Total RAM (with usage bar), CPU Cores/Logical, Physical Disk count, SQL Instance count, VM type badge |
| Operating System | OS caption, version/build, manufacturer/model, domain, last boot, uptime |
| Processor | Model, socket count, physical/logical cores per socket, max clock speed |
| RAM | Total/free memory, usage bar, DIMM slot count + per-DIMM: capacity, speed, type (DDR3/4/5) |
| Physical Disks | Disk#, model, size, type (SSD/HDD via MSFT_PhysicalDisk), interface, serial, partition count, drive letters (SHARED badge if >1) |
| Logical Drives | Drive letter, label, filesystem, total/used/free, usage bar with colour thresholds, extension recommendation when below threshold |
| Network | Adapter description, IPv4 addresses, MAC, DNS servers, gateway |
| SQL Instances | Instance name, service name, running status badge, start mode (via Win32_Service) |
Return Value
No pipeline output by default. With -PassThru, returns the full file path(s) as [string]. Files are also copied to the central share via Copy-sqmToCentralPath.
Examples
Example 1 — Local server (HTML, opens in browser)
Get-sqmServerHardwareReport
Example 2 — Remote server, return path
$path = Get-sqmServerHardwareReport -ComputerName "SQL01" -NoOpen -PassThru
Example 3 — Multiple servers, custom path
Get-sqmServerHardwareReport -ComputerName "SQL01","SQL02","SQL03" -ReportPath "C:\Reports" -NoOpen
Example 4 — CSV export for Excel
Get-sqmServerHardwareReport -ComputerName "SQL01","SQL02" -OutputFormat CSV -NoOpen
Example 5 — All formats at once
Get-sqmServerHardwareReport -ComputerName "SQL01" -OutputFormat All -NoOpen -PassThru
Example 6 — Pipeline input
"SQL01","SQL02" | Get-sqmServerHardwareReport -NoOpen