$serverName = 'SomeServer'
Invoke-Command -ComputerName $serverName -ScriptBlock {
Get-Process -IncludeUserName |
Where-Object {$_.UserName -like "${env:UserDomain}\*"} |
Sort-Object -Property CPU -Descending |
Select-Object -Property ProcessName, ID, CPU, UserName, Description -First 10
} | Format-Table -AutoSize -Property PSComputerName, ProcessName, ID, @{n='CPU'; e={$_.CPU.ToString('N2')}; a='Right'}, UserName, Description
The command to get the processes won't be getting shorter/less complex than this.
You can remove one of the Select-Objects, but will have to add a Where-Object filter to only show end users.
Open in new window