title: How to know idle time for process running in system
body: <p>All,</p>
  
  <p>I am using windows 7 os</p>
  
  <p>I would like to know the idle time for each application or process running in my machine.</p>
  
  <p>Ex: I opened one process like notepad.exe but I am not working on it from last 5 minutes, I need to get the idle time as 5 minutes for the process.</p>
  
  <p>like that at one time I would like to know the idle time of all process running in my machine.<br>
  I tried the below code but I am not getting the any data for IdleTime</p>
  
  <pre><code>$processname = Get-Process | Select-Object -Property ProcessName, IdleTime,ID,WS
  </code></pre>
  
  <p>Please help me</p>