Skip to content

Commit

Permalink
Create Monitor-CPU-Usage.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
rswio authored Jan 26, 2025
1 parent 92f147b commit 5de4987
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Monitoring/Monitor-CPU-Usage.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$Servers = @("Server1", "Server2") # Replace with your servers
foreach ($Server in $Servers) {
$CPU = Get-WmiObject -Class Win32_Processor -ComputerName $Server | Measure-Object -Property LoadPercentage -Average
Write-Output "CPU usage on $Server: $($CPU.Average)%."
}

0 comments on commit 5de4987

Please sign in to comment.