← script library

Automated System Information Gatherer Script

System AdministrationJanuary 14, 2025

This PowerShell script automates the process of gathering system information, including OS details, hardware specifications, and running services. By providing a comprehensive overview, this script is invaluable for system audits, troubleshooting, and inventory management.

powershell
$osInfo = Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object Name, Version, BuildNumber, OSArchitecture, LastBootUpTime
$osInfo

$cpuInfo = Get-CimInstance -ClassName Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed
$memoryInfo = Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum
$totalMemoryGB = [math]::round($memoryInfo.Sum / 1GB, 2)
$cpuInfo
$totalMemoryGB

$installedSoftware = Get-CimInstance -ClassName Win32_Product | Select-Object Name, Version, Vendor
$installedSoftware

$runningServices = Get-Service | Where-Object { $_.Status -eq 'Running' } | Select-Object DisplayName, ServiceName, Status
$runningServices

Write-Host "System Information Summary Report"
Write-Host "-------------------------------------"
Write-Host "Operating System: $($osInfo.Name), Version: $($osInfo.Version), Build: $($osInfo.BuildNumber), Architecture: $($osInfo.OSArchitecture)"
Write-Host "Last Boot Time: $($osInfo.LastBootUpTime)"
Write-Host "CPU Info: $($cpuInfo.Name), Cores: $($cpuInfo.NumberOfCores), Logical Processors: $($cpuInfo.NumberOfLogicalProcessors), Max Clock Speed: $($cpuInfo.MaxClockSpeed) MHz"
Write-Host "Total Physical Memory: $totalMemoryGB GB"
Write-Host "-------------------------------------"
Write-Host "Running Services:"
$runningServices | Format-Table -AutoSize
Write-Host "-------------------------------------"
Write-Host "Installed Software:"
$installedSoftware | Format-Table -AutoSize

Run it across your fleet

This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.

Ready when you are.

Try ServerEngine free for 7 days.