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:

[Logging]
LOGLEVEL=0
LOGMAXSIZE=524288000
LOGMAXHISTORY=3
DEBUGLOGGING=1
CCMDEBUGLOGGING=1

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):

smstslog_debuglogging

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:

CCMDEBUGLOGGING=1 CCMLOGLEVEL=0 CCMLOGMAXSIZE=52488000 CCMLOGMAXHISTORY=5 FSP=MYFSP.mydomain.com SMSCACHESIZE=35840

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:

EnableDebug_setvariable

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.

EnableDebug_setvariable-2

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")
oTSENV("SMSClientInstallProperties") = "CCMDEBUGLOGGING=1 CCMLOGLEVEL=0 CCMLOGMAXSIZE=52488000 CCMLOGMAXHISTORY=5 FSP=MYFSP.mydomain.com SMSCACHESIZE=35840"

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.

Greg

Issue: CCMSETUP Repeatedly Attempts to Install Visual C Redistributable, and Fails.

While installing the ConfigMgr 2012 client on a few systems today, I encountered an issue where CCMSetup fails to install the Visual C Redistributable (a required component for the ConfigMgr client). The error in ccmsetup is here:

<![LOG[File 'C:\Windows\ccmsetup\vcredist_x86.exe' returned failure exit code 1603. Fail the installation.]LOG]!><time="02:02:57.870+300" date="07-05-2012" component="ccmsetup" context="" type="3" thread="1836" file="manifest.cpp:1972">
msiexec /i vcredist.msi /qn"" "'.]LOG]!>

And when I attempted to install that .exe manually, I received the following error:

“Error 1935. An Error occurred during the installation of assembly ‘Microsoft.VC90.ATL…HRESULT: 0x80070BC9”

After a bit of research, I found KB970652, which then led me to KB946414. My fix was to delete this registry value:

  • HKEY_LOCAL_MACHINE\COMPONENTS\PendingXmlIdentifier

And then reboot the system and attempt ConfigMgr installation again. In my case, this fixed the issue on all three systems stuck in this endless vc_redist installation loop.

 

Greg

ramseyg@hotmail.com