need to find which process using is consuming more CPU on remote computer including whole CPU usage of server.
i have tried below script, it give process wise of cpu usage, including this i would require whole cpu consumption of the server, like Task manager in windows.
$servers = Get-Content c:\temp\servers.txt
$ErrorActionPreference = 'silentlycontinue'
foreach ($server in $servers)
{
try{
Invoke-Command -scriptblock {Get-Process | Sort CPU -descending | Select -first 5 } -computername $servers
}
catch{
Write-Warning "System Not reachable:$server"
}
}