Tag Archives: Microsoft Windows

Enabling complete system memory dumps & more with Powershell

Configuring your systems for full crash dumps is extremely useful, especially in VDI / SBC environments where a number of core layers make up the users desktop.

To simplify the process, decisions around the page file and enabling the various crash dump methods I wrote the following powershell function to cover all these bases.

This powershell function is system managed page file aware, allows you to configure the pagefile by a multiple of physical ram and also allows you to configure either Crash on Ctrl Scroll lock, or NMI Crash dumps all in one place.You can also specify system recovery options on the command line to tell the system what to do in the event of a crash.

As this is quite a large function, I’ve included help test for reference. Below you will find some examples of how to use this function:

enable-completememorydump
This command will enable complete memory dumps using the system specified pagefile if possible.

enable-completememorydump -setpagefilesize -pagefilelocation “c:pagefile1.sys” -multiple 2 -forcerestart
This command forces the pagefile to be Ram * 2, sets the page file location to a new file (pagefile1.sys) and forces a restart on completion.

enable-completememorydump -setpagefilesize -forcerestart
This command forces the pagefile to be Ram * 1.5 (the default) and forces a restart on completion.

enable-completememorydump -setpagefilesize -forcerestart -CrashOnCtrlScroll -NMICrashdump
This command forces the pagefile to be Ram * 1.5 (the default), enables crash on ctrlscroll and nmicrashdumps and forces a restart on completion.

 enable-completememorydump -RebootafterCrash:$false -OverwriteExistingDebugFile:$false
This command enables complete memory dumps, but specifies not to restart after a crash dump, or overwrite an existing dump file.

Below you can see an example of the command line and expected output:

Click the link below to get a copy of the full function.

Continue reading