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

Fix for error in IIS log on MP – (bits_error:,501,0×80070005)

On one of my accounts, we found that hw/sw inventory seems to no longer update.

We found this error in IIS logs on the MP:

(bits_error:,501,0×80070005)

We also noticed that if you go to Server Manager, and open Roles->Web Server (IIS), and select Default Web Site (or the WSUS Administration site), then select BITS Uploads, and then Open Feature, you receive the following message:

“BITS server was unable to read from the IIS Meta-base as it is corrupt. The settings for this virtual Directory have been reset to the BITS defaults. Parameter count mismatch.”

I installed KB2587894, but the error still occurred.

Next, I decided to follow the wisdom of the myITforum and TechNet forums, and reinstall BITS on the server (restart required).  After reinstall, I confirmed that I can open the BITS properties on each web site, and then had to launch mp.msi to get the MP configured properly (the WSUS site seemed to be working OK).  All is well now – inventory is reprorting fine.

Greg

Interesting issue with thumbs.db

I’m surprised I just ran into this today – seems easy enough to run into a long time ago.  I was working in ConfigMgr 2012 Beta 2, and was receiving failures when sending content to a distribution point. Looking at distmgr.log, I saw the following errors:

CreateFileW failed for \\servername\sharename\thumbs.db

Failed to add the file. Please check if this file exists. Error 0×80070020

 

Thumbs.db is a hidden file that contains a thumbnail cache for the current directory. I tried to delete the file, and received an error that the file was in use by Windows Explorer. I decided to test this same process in ConfigMgr 2007, and encountered the same issue (which is why I’m surprised I haven’t experienced this issue before). Finally, I terminated and restarted my Windows Explorer process (explorer.exe), and then could successfully delete the evil thumbs.db, and could then update my distribution points successfully.

To prevent this in the future, you need to disable the creation of the thumbnail cache. You can read more for how to disable this using either folder options or group policy. Both links refer to Windows 7, but the same applies to Server 2008R2. You would need to disable this feature on any system you use to browse to the package source. This issue obviously doesn’t occur all the time, but is something to be aware of moving forward.

*Note: this can also affect you if a user who has admin rights browses to a ConfigMgr DP share and thumbs.db is created. Now the hash of this folder if different than ConfigMgr expects, causing a hash mismatch error when running the program.

 

Greg

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.

 

Greg

 

ramseyg@hotmail.com

How To: Enable Debug Logging for ConfigMgr 2012 Admin Console

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

  1. From an administrator command prompt, open the following with Notepad: “C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\Microsoft.ConfigurationManagement.exe.config”
  2. Search for switchValue=”Error”, and change to switchValue=”Verbose” (as shown below), and save changes.
  3. Restart the admin console for debug logging to take effect.

image

Follow

Get every new post delivered to your Inbox.

Join 1,044 other followers