How To: Enable Debug Logging for an OS Deployment Task Sequence

Previously, we covered how to enable debug logging for the ConfigMgr client agent as well as the ConfigMgr 2012 admin console. This post will focus on enabling debug logging for an OSD TS.  This process is a little different when starting OSD from WinPE, as you are starting in a state with no client agent installed.

* There are two steps required to fully enable debug logging for OSD task sequences – 1) WinPE phase (before ‘Setup Windows and Configmgr TS Step), and 2) Windows Phase (during ‘Setup Windows and ConfigMgr TS Step’)

Enabling Debug Logging for WinPE:

Create a file named smsts.ini with the following contents:


Here’s a brief description of each property (review detailed info on TechNet):

LogLevel = 1 is the default value, set this to 0 for the most verbose logging

LogMaxSize = Maximum log file size in bytes – the example is 524288000 bytes (250000 default)

LogMaxHistory = The number of history (aka ‘rollover’) logs to keep (1 is default)

DebugLogging = Set this to 1 (True) to enable debug, which will provide more detail

CCMDebugLogging = Set this to 1 (True) to enable debug, which will provide more detail **I don’t think this is necessary, as we are doing this in the previous step (DebugLogging), but MS has told me multiple times to do it, so I include it.

Next, you need to mount the boot.wim file that will be used for OSD, and copy the file to the \windows directory. Unmount the .wim and commit changes  (Note that the latest version of dism.exe uses the mount-image argument–previous versions used mount-wim).

Now that you have updated the boot.wim, update DPs, and re-create your task sequence boot media. Another note – * Some OSD-savvy admins may attempt to simply open a command prompt at the WinPE welcome screen and drop the smsts.ini file in the x:\windows directory, but this will not work. Smsts.ini must exist in the boot media which is booted to start OS deployment, as it appears to be consumed before the welcome screen appears.

When you launch a TS from WinPE, you will find the following entries in smsts.log (after clicking Next to the welcome screen):


Congratulations – you’re half-way there. If you only want to debug during WinPE,  you can stop here. But be advised that as soon as the TS completes the “Setup Windows and ConfigMgr” step, the debug logging (and any additional customizations from the smsts.ini file) will be removed. To preserve the log, continue to the next step:

Enabling Debug Logging for the Windows Phase:

During the “Setup Windows and ConfigMgr” TS step, mini-setup runs, and the ConfigMgr client is installed. The logging used from this point forward will be based on the installation parameters defined during the “Setup Windows and ConfigMgr step. So if you had a larger max log size and history in WinPE, and take the default config for “Setup Windows and ConfigMgr”, that extended logging will be removed (and logs overwritten) as soon as the TS continues from the Windows OS. You could simply modify the arguments for that step to be similar to the following:


But please understand this will enable debug logging for the ConfigMgr client agent, which means these settings will apply to all client logging (unless you run something to modify logging at a later point in time). A better scenario would be to only enable the configuration on an as-needed basis. Here’s how I recommend enabling debug logging (and preserving the debug logging provided in WinPE) as needed in a TS.

Create a TS step to set a TS variable:


The variable SMSClientInstallProperties is a builtin TS variable that will override values entered into the “Setup Windows and ConfigMgr” TS step. To take this a step further, create a conditional for this step to only run if x:\debug.txt exists.


To leverage this, you can simply open a command prompt while the TS is running (before this step would run) and create a file called debug.txt in the root of x:\.

If you don’t want to add a step to the TS, you could launch a command prompt while the TS is running in WinPE, and run the following VBScript:

Set oTSEnv = CreateObject("Microsoft.SMS.TSEnvironment")

This will set the TS variable for a one-time use for this TS.

To recap, I recommend enabling debug logging while in WinPE, and only configure debug logging for the ConfigMgr client as needed. This will give you more debugging while in WinPE, and clean up everything back to your corporate standard after Windows is installed. And then as needed, you can easily add debug logging to the ConfigMgr client agent.


How To: Enable Debug Logging for the ConfigMgr 2012 Client Agent

Sometimes you need to see a little more detail in the log files. Here’s a quick post for how to enable debug logging on the ConfigMgr 2012 Client:

  1. Launch Regedit.exe as an administrator.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL and modify the following as desired:
    1. LogLevel = 1 (default)  – Set this value to 0 (zero) to enable Debug Logging
    2. LogMaxHistory = 1 (default) – This is the maximum number of rollover log files to keep.  Increase this number to keep additional rollover logs.
    3. LogMaxSize = 250000 (decimal, which is 245 kb) – increase this number to increase the max log size for each log.
  3. Navigate to [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging], and Create a new KEY of the name “DebugLogging”
  4. Cycle the SMS Agent Host service (ccmexec.)

(*Note: In ConfigMgr 2012, we have an x86 and an x64 client, so no need to go through the Wow6432Node registry tree.)

Debug logging is great, but it does add some overhead, so be sure to remove the debug logging settings as soon as possible.