As the first post in the Configuration Manager OSD Support Team Blog, I am going to go over something that affects us a lot in CSS - increasing the size of the SMSTS.log and specifying how many times it rolls over. Many times when troubleshooting customer issues with a Task Sequence, we discover that the logs have rolled over and that we have lost the logging and history of what happened when the issue actually occurred. Without these logs and history it makes it very difficult to determine what the problem is.

Luckily both the SMSTS.log size and the amount of time it rolls over can be changed. The tricky part though is that in order for the changes to apply during the entire Task Sequence, you may need to make these changes up to three times during the Task Sequence.

Here are two quick tips regarding the below article:

  1. Instead of following the below article, in certain circumstances for troubleshooting purposes the advertisement for the Task Sequence can temporarily be changed from "Download content locally when needed by running task sequence" to "Access content directly from a distribution point when needed by the running task sequence". Doing this will cause package files needed by the Task Sequence to be used directly on the Distribution Point instead of being downloaded locally to the computer. This will eliminate all of the logging that occurs in the SMSTS.log when the file downloads occur for the packages. This should dramatically cut down on the size of the SMSTS.log file, especially if there are packages with a lot of files in them, such as the MDT Toolkit Package or the USMT Package. This end result will be that the SMSTS.log does not roll over as often, causing the errors In the SMSTS.log not to be lost. Of course if the issue ends up being something related to file downloads, this tip may actually hide what the problem is.

  2. The method described below to inject the SMSTS.ini file into the Boot Image using the osdinjection.xml file can actually be used to inject ANY file into the Boot Image, such as Trace32.exe. The related files that need to be injected would just need to be copied to the appropriate directories on the ConfigMgr site server and the the XML code updated to specify what files need to be injected and where they need to be injected. This is usually easier and faster than having to manually mount the Boot Images and manually inject the files. It also quicker and easier updates to these files when the files need to be updated on the Boot Image.

 

Update 2012-02-29

  • Made some corrections regarding how to enable debug logging in the original OS.

 

How To Change Logging Options For SMSTS.log in System Center Configuration Manager 2007

 

Symptom

When deploying a Task Sequence, there may be times that the options of the SMSTS.log file need to be changed, such as increasing the size of the log or the amount of historical logs (rolled over logs) that are created. If the SMSTS.log size is not increased or the amount of historical logs is not increased, information about what happened during the Task Sequence may be lost. In troubleshooting scenarios this may make it difficult to determine what is causing problems.

The Task Sequence has the potential of running in three different Windows OSes before it completes:

  1. Original Windows OS (Replace and Refresh scenarios only)

  2. Windows PE (New Computer, Replace, and Refresh scenarios)

  3. Newly deployed Windows OS (New Computer, Replace, and Refresh scenarios)

Because of this, if options for the SMSTS.log file need to be changed, they may need to be changed each time the Windows OS changes. This can be up to three different times during a Task Sequence.

Resolution

In order to change the options for the SMSTS.log, they need to be changed in three different locations:

  1. For the original Windows OS, in the registry (Replace and Refresh scenarios only)

  2. For Windows PE, in the SMSTS.ini file in the Windows directory of the WinPE Boot Image

  3. For the newly installed Windows OS, in the Setup Windows and ConfigMgr task of the Task Sequence

Additionally, in order for the logging options to work properly throughout the deployment, the settings for the logging options should match and be the same during each stage of the deployment.


Original Windows OS: Modify the registry in the original Windows OS (Replace and Refresh scenarios only)

When the ConfigMgr client is originally installed on a PC, the ConfigMgr client logging options can be set via MSI properties in the command line of the client install. These options include the following parameters:

CCMDEBUGLOGGING
CCMENABLELOGGING
CCMLOGLEVEL
CCMLOGMAXHISTORY
CCMLOGMAXSIZE

The above parameters are described in the following TechNet article:

About Configuration Manager Client Installation Properties
http://technet.microsoft.com/en-us/library/bb680980.aspx

To change any of the above parameters after the ConfigMgr client has been installed, instead of reinstalling the client with the necessary parameters, the corresponding registry entries can be changed instead:

CCMDEBUGLOGGING

ConfigMgr 2007 32bit OSes and all ConfigMgr 2012
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\DebugLogging!Enabled

ConfigMgr 2007 64bit OSes
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\DebugLogging!Enabled

A STRING value of TRUE enables debug logging. Deleting the DebugLogging key disables debug logging.

CCMENABLELOGGING

ConfigMgr 2007 32bit OSes and all ConfigMgr 2012
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL\debuglogging!LogEnabled

ConfigMgr 2007 64bit OSes
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432NodeMicrosoft\CCM\Logging\debuglogging!LogEnabled

A DWORD value of 1 enables logging, while a DWORD value of 0 disables logging. The default is 1 (enabled).

CCMLOGLEVEL

ConfigMgr 2007 32bit OSes and all ConfigMgr 2012
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL!LogLevel

ConfigMgr 2007 64bit OSes
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432NodeMicrosoft\CCM\Logging\@GLOBAL!LogLevel

The value can be a DWORD value from 0 to 3, with 0 being the most verbose logging. The default value is 1.

CCMLOGMAXHISTORY

ConfigMgr 2007 32bit OSes and all ConfigMgr 2012
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL!LogMaxHistory

ConfigMgr 2007 64bit OSes
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432NodeMicrosoft\CCM\Logging\@GLOBAL!LogMaxHistory

The value is a DWORD value that specifies the amount of rolled over/historical logs to keep. This does not include the current log. A value of 3 would keep a total of 4 logs - the current log and 3 rolled over/historical logs. The default value is 1.

CCMLOGMAXSIZE

ConfigMgr 2007 32bit OSes and all ConfigMgr 2012
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL!LogMaxSize

ConfigMgr 2007 64bit OSes
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432NodeMicrosoft\CCM\Logging\@GLOBAL!LogMaxSize

The value is a DWORD value for the size of the log file in bytes. The default value is 250000(decimal)/3d090(hexadecimal) which equals 250000 bytes (approximately 245 KB).

Generally, for the purposes of the SMSTS.log and OSD, the only three parameters that need to be changed are CCMLOGLEVEL, CCMLOGMAXHISTORY, and CCMLOGMAXSIZE. Logging is set by default, so CCMENABLELOGGING normally does not need to be changed.

Please note that changing any of the above values changes the settings for ALL ConfigMgr client logs, not just the SMSTS.log.

After the value of any of the above values has been changed in the registry, the ConfigMgr client needs to be restarted in order for the changes to take effect. This can be done by restarting the ConfigMgr client service (SMS Agent Host) or restarting the computer.

Since a restart of the ConfigMgr client needs to take place, any of changes to the values of the above registry keys cannot take place during a Task Sequence. Any attempt to restart the ConfigMgr client service in the full Windows OS while the Task Sequence is running may kill the Task Sequence and cause it to fail. For this reason, any changes to the above registry key values, and the subsequent restart of the ConfigMgr client service, need to be done outside of a Task Sequence and before the Task Sequence begins (i.e. manually, normal ConfigMgr Software Distribution, Domain Policy, etc.)

Please note that in Replace scenarios, the above changes would need to be done on the original/old computer.

If when attempting to modify any of the above registry keys you receive the following error message:

Error Editing Value
Cannot edit <value>: Error writing the value's new contents

where <value> is the key value trying to be changed, this is usually due to insufficient permissions on the @GLOBAL registry key for the user trying to make the change. To resolve the issue, modify the permissions of the @GLOBAL key to allow the user making the changes to modify the values under the key.

 

Windows PE Boot Image: Add the SMSTS.ini file to the Windows Directory of the Boot Images (New Computer, Refresh, and Replace scenarios)

During an OSD Task Sequence, when the PC boots into WinPE from the Boot Image, the SMSTS.log settings are not controlled via the same registry keys as in the full Windows OS. Instead the SMSTS.log settings are controlled via entries in a file called SMSTS.ini file which resides in the Windows directory of WinPE.

In order to change the logging options for the SMSTS.log file while in WinPE, the SMSTS.ini file has to be either created or modified with the appropriate parameters. If no SMSTS.ini file exists in the Windows directory of WinPE, then default values are used. By default, the SMSTS.ini file does not exist in the default Boot Images of ConfigMgr and therefore the default options are used.

The logging options and values that can be modified are:

DEBUGLOGGING
ENABLELOGGING
LOGLEVEL
LOGMAXHISTORY
LOGMAXSIZE

The value names are basically the same as the registry value names from the full OS, but without the preceding CCM prefix. Similar to logging in the full OS, for the purposes of the SMSTS.log and OSD, the only three parameters that usually are changed are LOGLEVEL, LOGMAXHISTORY, and LOGMAXSIZE. The value of LOGMAXSIZE is specified in bytes (decimal).

To modify the values, in NotePad, create a SMSTS.ini file with a [Logging] section that contains the parameters that need to be modified. The file then needs to be injected in the Windows directory of the Boot Image. The SMSTS.ini file has to be in place BEFORE the Task Sequence begins in WinPE. For this reason, the SMSTS.ini file cannot be added or copied to the appropriate location as part of the Task Sequence.

For example, to change the SMSTS.log file size to 5MB, set the log level to the most verbose level, and increase the amount of rolled over/historical logs to 3, the following would be the contents of the SMSTS.ini file:

[Logging]
LOGLEVEL=0
LOGMAXSIZE=5242880
LOGMAXHISTORY=3

Note: The logging options in the SMSTS.ini file are case sensitive and should be entered in all uppercase.

Injecting the SMSTS.ini file into the Boot Image

ConfigMgr stores files to be injected into the Boot Images under the following two directories on the site server:

  • x86 Boot Images
    <ConfigMgr_Install_Directory>\OSD\bin\i386
  • x64 Boot Image
    <ConfigMgr_Install_Directory>\OSD\bin\x64

The files located in the above two directories are not necessarily automatically injected into the Boot images. An XML file is used which defines which files need to be injected, where the files are located within the BIN directory, and where they need to be copied to within the WinPE Boot Image. The name of this XML file is osdinjection.xml. It is located in the following directory on the site server:

  • ConfigMgr 2007
    <ConfigMgr_Install_Directory>\bin\i386

  • ConfigMgr 2012
    <ConfigMgr_Install_Directory>\bin\x64

Please note that the above directory is NOT the same as where the files to be injected reside. Additionally only one osdinjection.xml file is needed for both x86 and x64 Boot Images.

To inject the SMSTS.ini file into the Boot Images:

  1. Using NotePad, create an SMSTS.ini file with the desired parameters. When saving the file in NotePad, make sure it has the extension of .ini and not .txt.

  2. Copy the SMSTS.ini file created in Step #1 into the appropriate directories on the ConfigMgr site server where the Boot Images are located. The file has to be copied to two separate directories - one for x86 Boot Image and one for x64 Boot Images.

    The directories to copy the file to are:

    <ConfigMgr_Install_Directory>\OSD\bin\i386


    and

    <ConfigMgr_Install_Directory>\OSD\bin\x64
     
  3. Once the SMSTS.ini file is copied to the appropriate directories on the ConfigMgr site server, navigate to the following directory:

    <ConfigMgr_Install_Directory>\bin\i386

  4. Create a backup of the file osdinjection.xml located in the <ConfigMgr_Install_Directory>\bin\i386 directory.

  5. Open the original osdinjection.xml file in NotePad. Add sections to both the i386 and x64 portions of the osdinjection.xml file specifying to inject the SMSTS.ini file into the Windows directory of the x86 and x64 Boot Image:

  • For the x86 Boot Image, find the section:

     <File name="CcmGenCert.dll">
    <LocaleNeeded>false</LocaleNeeded>
    <Source>bin\i386</Source>
    <Destination>sms\bin\i386</Destination>
    </File>

    Add the following section immediately after the above section but before the line containing </FileList>

    <File name="smsts.ini">
    <LocaleNeeded>false</LocaleNeeded>
    <Source>bin\i386</Source>
    <Destination>Windows</Destination>
    </File>

  • For the x64 Boot Image, find the section:
     
    <File name="CcmGenCert.dll">
    <LocaleNeeded>false</LocaleNeeded>
    <Source>bin\x64</Source>
    <Destination>sms\bin\x64</Destination>
    </File>

     
    Add the following section immediately after the above section but before the line containing </FileList> :
     
    <File name="smsts.ini">
    <LocaleNeeded>false</LocaleNeeded>
    <Source>bin\x64</Source>
    <Destination>Windows</Destination>
    </File>

  • Save the osdinjection.xml file in NotePad.

  • In the ConfigMgr 2007 console, navigate to "Site Database" --> "Computer Management" --> "Operating System Deployment" --> "Boot Images".

  • Right click on the desired Boot Image to be updated with the SMSTS.ini file and choose "Update Distribution Points".

  • In the "Summary" page of the "Manage Distribution Points Wizard" window, click on the "Next >" button and allow the Boot Image to be rebuilt.

  • Once the Boot Image is finished rebuilding, in the "Wizard Complete" page of the "Manage Distribution Points Wizard" window, click on the "Close" button.

  • Repeat Steps 8-10 for each Boot Image in the environment.

Once the Distribution Points have finished updating for each Boot Image, each Boot Image should have the updated log settings for the SMSTS.log.

As an option, instead of using the above process, after the SMSTS.ini has been created, it can be manually injected into the Windows directory of the Boot Image using ImageX or DISM. However using the above process preserves and does not modify the original Boot Image (boot.wim), so it is the preferred method.

 

Newly installed Windows OS: Add logging options to the Setup Windows and ConfigMgr task of the Task Sequence (New Computer, Refresh, and Replace scenarios)

Since the ConfigMgr client is always installed as part of a ConfigMgr OSD Task Sequence, the MSI properties to set logging options, as explained under the section "Modify the registry in the original Windows OS", can be used to change the logging options of the SMSTS.log:

  1. In the ConfigMgr 2007 console, navigate to "Site Database" --> "Computer Management" --> "Operating System Deployment" --> "Task Sequences".

  2. Right click on the desired OSD Task Sequence where the SMSTS.log logging options need to be modified and select "Edit".

  3. In the Task Sequence select the "Setup Windows and ConfigMgr" task.

  4. In the "Installation properties" text box of the "Setup Windows and ConfigMgr" task, add in any of the MSI properties to set logging options as explained in "Modify the registry in the original Windows OS".

    Note: The MSI properties are case sensitive and should entered in all uppercase.

  5. Click on the "OK" or "Apply" button to save the Task Sequence.

  6. Repeat Steps 2-5 for any additional Task Sequences that need to be modified.

For example, to change the SMSTS.log file size to 5MB, set the log level to the most verbose level, and increase the amount of rolled over/historical logs to 3, the following would be added to the "Installation properties" text box of the "Setup Windows and ConfigMgr" task:

CCMLOGMAXSIZE=5242880 CCMLOGLEVEL=0 CCMLOGMAXHISTORY=3

Please note that any changes made to the logging options in the "Installation properties" text box of the "Setup Windows and ConfigMgr" task will affect ALL ConfigMgr client logs and not just the SMSTS.log.

Note: Make sure that an SMSTS.ini file does not exist in the newly installed Windows OS. Adding or copying a SMSTS.ini file to the Windows directory of the newly installed Windows OS will not work and may conflict with the MSI properties specified at the "Setup Windows and ConfigMgr" task.

Frank Rojas
Support Escalation Engineer