Getting SysInternals Procdump to work with multiple processes

As a consultant, the SysInternals procdump utility, available here, is a great tool that I use frequently to capture process dumps, most often in the following situations (which are only some of its capabilities):

  • Persistent high CPU consumption
  • Unhandled exceptions aka crash
  • Hanging

However, it has one shortcoming which is that if you have multiple processes of the same name then you need to specify the individual process ids (PIDs) of the processes you want to monitor which is a tad painful and time consuming.


PS C:\> & 'C:\Program Files\Sysinternals\procdump.exe' -ma -e chrome.exe
ProcDump v8.0 - Writes process dump files
Copyright (C) 2009-2016 Mark Russinovich
Sysinternals - www.sysinternals.com
With contributions from Andrew Richards
[18:01:52] Multiple processes match the specified name.


To work around this, I’ve written a PowerShell script that allows you to specify a list of names of processes and it will spawn a procdump process for each process it finds of that name. For instance:


Procdumper.ps1 -Procdump 'c:\program files\sysinternals\procdump.exe' -highCpu 95 -processes excel,winword -dumpFolder c:\temp\dumps


This will launch a procdump process, in a visible window, for all excel.exe and winword.exe processes that it finds where the procdump process will create a dump, if triggered, in a sub-directory named after the user running the process in the c:\temp\dumps folder. It will then check every 5 minutes to see if there are any newly launched processes and monitor these too. Any processes that exit in the meantime will have their procdump processes automatically terminated. You can change this loop frequency with the –sleepFor parameter or give it a value of zero if you don’t want it to loop.


Note that we also have to tell it where to find the procdump utility itself.
There is also the ability to only include processes from a list of users, via the –includeUsers option, or to exclude processes from a list of users via the –excludeUsers option.


You can use the standard Get-Help cmdlet to get more information on other parameters it supports, such as the different triggers for dumps like –exception and –hang.

The script is available for download here.

To view or add a comment, sign in

More articles by Guy Leech

Others also viewed

Explore content categories