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 you may need to make this change in up to three different areas.

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 files 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 packages. This will 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 may cause the SMSTS.log not to roll over, resulting in the errors causing the issue to be seen in the SMSTS.log. 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 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 allows easier update of these files.

 

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

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.

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


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, the corresponding registry entries need to be changed:

CCMDEBUGLOGGING

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

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

In the case of CCMDEBUGLOGGING, only the parent key needs to be created. A value under the key does not need to exist.

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 disabled 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 for 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 (decimal). The default value is 250000 (decimal), or 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 will kill the Task Sequence and cause it to fail (since the Task Sequence engine is dependent on the ConfigMgr client service). 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. normal ConfigMgr Software Distribution, Domain Policy, etc.)

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.

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

 

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 files has to be either created or modified. If no SMSTS.ini file exists, then default values are used. By default, the SMSTS.ini file does not exist in the default Boot Images of ConfigMgr so 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, LOGMAXSIZE. The value of LOGMAXSIZE is specified in bytes.

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.

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

To inject the SMSTS.ini file into the Windows directory of a Boot Image, the file osdinjection.xml can be modified to add the SMSTS.ini file as one of the files to be injected when the Boot Image is updated. The file osdinjection.xml contains information on which files should be injected into the Boot Image and where they should be injected.

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

    These directories contain the files that are injected into the appropriate Boot Images.

  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

    Create a backup of the file osdinjection.xml.

  4. 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>

  5. Save the osdinjection.xml file in NotePad.

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

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

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

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

  10. Repeat Steps 7-9 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 osdinjection.xml file 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".

  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.