Quickly Check System Resource Utilization with PowerShell
In this post, we will present a PowerShell script that allows you to quickly check the system resource utilization on your Windows machine. Monitoring CPU, memory, and disk usage is critical for maintaining optimal performance and identifying potential issues before they escalate. This script gathers and displays the current resource utilization stats in an easy-to-read format, helping you keep your systems healthy. Here is the PowerShell script for checking system resource utilization:
# Get CPU usage
$cpuUsage = Get-WmiObject Win32_Processor | Measure-Object -Property LoadPercentage -Average
$avgCpuLoad = $cpuUsage.Average
# Get Memory usage
$memory = Get-WmiObject Win32_OperatingSystem
$totalMemory = $memory.TotalVisibleMemorySize / 1MB
$freeMemory = $memory.FreePhysicalMemory / 1MB
$usedMemory = $totalMemory - $freeMemory
# Get Disk usage
$disks = Get-PSDrive -PSProvider FileSystem
# Display results
Write-Host "CPU Load: $avgCpuLoad%"
Write-Host "Total Memory: $([math]::round($totalMemory, 2)) MB"
Write-Host "Used Memory: $([math]::round($usedMemory, 2)) MB"
Write-Host "Free Memory: $([math]::round($freeMemory, 2)) MB"
foreach ($disk in $disks) {
$used = [math]::round($disk.Used / 1GB, 2)
$free = [math]::round($disk.Free / 1GB, 2)
$total = [math]::round($disk.Used / 1GB + $disk.Free / 1GB, 2)
Write-Host "$($disk.Name): Used $used GB, Free $free GB, Total $total GB"
}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.
More in Monitoring & Health
Disk Space Cleanup and Report Script
2025-01-14User Account Status Reporting Script
2025-01-13Automated Disk Space Monitoring Script
2025-01-13Monitor System Performance with PowerShell
2025-01-12Automating System Health Check with PowerShell
2025-01-05Automate System Performance Monitoring with PowerShell
2024-12-30Ready when you are.
Try ServerEngine free for 7 days.