Bonjour,
je cherche à consulter l'activité CPU d'un serveur distant.
En fouillant sur internet, j'ai récupéré un script à exécuter en local:
Code powershell : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 # Option A: This is if you just have the name of the process; partial name OK $ProcessName = "SQL" # Option B: This is for if you just have the PID; it will get the name for you #$ProcessPID = "6860" #$ProcessName = (Get-Process -Id $ProcessPID).Name $CpuCores = (Get-WMIObject Win32_ComputerSystem).NumberOfLogicalProcessors $Samples = (Get-Counter "\Process($Processname*)\% Processor Time").CounterSamples $Samples | Select ` InstanceName, @{Name="CPU %";Expression={[Decimal]::Round(($_.CookedValue / $CpuCores), 2)}}
Comment l'utiliser pour interroger un serveur distant SVP?
merci pour votre aide!
Partager