I need to collect the pecentage of CPU time (percentage, not total CPU time ad displayed by command TASKLIST /V) for all the processes on a Windows server.
I see I can get the values I need by using the command:
wmic path Win32_PerfFormattedData_PerfProc_Process where “PercentProcessorTime > 0” get PercentProcessorTime, Name, idprocess
However, I need to get 2 additional information: a timestamp with the time the command was executed, and the user associated with the process.
Is there any sample I can start from?