Tracking real time threads.


Windows PowerShell (free and used by admins and within AD, 
Exchange, IIS and etc.) is the Windows admin's automation 
tool. One can use PowerShell for tracking Apache processes, 
use httpd.exe, php, perl whatever. But for here one is using 
notepad so all Windows users with Windows PowerShell can play 
along.  The below is in a PowerShell console window (like cmd).

 

PS > notepad
PS > notepad
PS > $theProcesses = [System.Diagnostics.Process]::GetProcessesByName("notepad")
PS > $theProcesses

 

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
     53       5     1904       8152    77     0.06   1944 notepad
     53       5     1896       8260    77     0.05   3400 notepad

 

PS > $theProcesses[0].Threads

 

BasePriority            : 8
CurrentPriority         : 10
Id                      : 2200
IdealProcessor          :
PriorityBoostEnabled    : True
PriorityLevel           : Normal
PrivilegedProcessorTime : 00:00:00.0312002
StartAddress            : 2009171824
StartTime               : 3/7/2009 1:07:54 PM
ThreadState             : Wait
TotalProcessorTime      : 00:00:00.0624004
UserProcessorTime       : 00:00:00.0312002
WaitReason              : UserRequest
ProcessorAffinity       :
Site                    :
Container               :

 

Notice the start time above, well try this

 

PS > $theProcesses[0].Threads[0].StartTime

 

Saturday, March 07, 2009 1:07:54 PM

 

Just keep repeating or automate this in a 
name.ps1 file for current results!

 

Perhaps more later like TCP results, charting,
process stats (and what is needed?) examples!

 

 

 

_________________________________________________________________
Express your personality in color! Preview and select themes for Hotmail®. 
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme

Reply via email to