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


 

Want to set the logging quickly without reading a bunch of details? Then follow the below three sections:

  1. Automate modifying the SMSTS.log settings before the Task Sequence executes in the original OS
    • Only needed if Task Sequence will be started in full OS via Software Center/Run Advertised Programs or a Required/Mandatory deployment
    • Only section needed for In-Place Upgrade scenarios
  2. Inject the SMSTS.ini file into the Boot Images
    • Always needed for Replace/Refresh/New Computer scenarios so always follow for these scenarios!
    • Not needed for In-Place Upgrade scenarios
  3. Set the SMSTS.log settings in the newly installed Windows OS
    • Always needed for Replace/Refresh/New Computer scenarios so always follow for these scenarios!
    • Not needed for In-Place Upgrade scenarios

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, Refresh, and In-Place Upgrade 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.

IMPORTANT NOTE!
Except for In-Place Upgrade scenarios where WinPE is not used, the logging values used THROUGHOUT the Task Sequence is always initialized in WinPE. For this reason, even if extended logging is only needed in the newly installed Windows OS, the section regarding WinPE and adding an SMSTS.ini file into the boot image should ALWAYS be followed. Not doing so will result in extended logging not being enabled while the Task Sequence is running and instead will only be enabled AFTER the Task Sequence completes.

 

Original Windows OS: Modify the registry in the original Windows OS (Replace, Refresh, & In-Place Upgrade 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 properties:

CCMDEBUGLOGGING
CCMENABLELOGGING
CCMLOGLEVEL
CCMLOGMAXHISTORY
CCMLOGMAXSIZE

The above properties are described in the following TechNet articles:

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

System Center 2012 Configuration Manager
About Client Installation Properties in Configuration Manager
http://technet.microsoft.com/en-us/library/gg699356.aspx

System Center Configuration Manager (Current Branch)
About client installation properties in System Center Configuration Manager
https://technet.microsoft.com/en-us/library/mt489016.aspx

To change any of the above properties after the ConfigMgr client has been installed, instead of reinstalling the client with the necessary parameters, the corresponding registry entries can be changed either manually or via a REG.exe command line:

 

CCMDEBUGLOGGING

ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\DebugLogging

ConfigMgr 2007 64bit clients
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\DebugLogging

Value name: Enabled
DataType: Reg_SZ

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

An example of setting or changing CCMDEBUGLOGGING via a REG.exe command line would be:

REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\DebugLogging" /v Enabled /t REG_SZ /d TRUE /f

In the above example command line, debug logging is turned on.

 

CCMENABLELOGGING

ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL

ConfigMgr 2007 64bit OSes
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\@GLOBAL

Value name: LogEnabled
DataType: Reg_DWORD

A value of 1 enables logging, while a value of 0 disables logging. The default is 1 (enabled). Since logging is enabled by default, CCMENABLELOGGING normally does not need to be changed.

An example of setting or changing CCMENABLELOGGING via a REG.exe command line would be:

REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogEnabled /t REG_DWORD /d 1 /f

In the above example command line, logging is enabled.

 

CCMLOGLEVEL

ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL

ConfigMgr 2007 64bit clients
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\@GLOBAL

Value name: LogLevel
DataType: Reg_DWORD

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

An example of setting or changing CCMLOGLEVEL via a REG.exe command line would be:

REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogLevel /t REG_DWORD /d 0 /f

In the above example command line, the log level is set to the most verbose.

 

CCMLOGMAXHISTORY

ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL

ConfigMgr 2007 64bit OSes
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\@GLOBAL

Value name: LogMaxHistory
DataType: Reg_DWORD

The value 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.

An example of setting or changing CCMLOGMAXHISTORY via a REG.exe command line would be:

REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxHistory /t REG_DWORD /d 3 /f

In the above example command line, the number of rolled over logs that are kept is increased to 3.

 

CCMLOGMAXSIZE

ConfigMgr 2007 32bit clients and all ConfigMgr 2012/ConfigMgr Current Branch clients
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL

ConfigMgr 2007 64bit clients
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\@GLOBAL

Value name: LogMaxSize
DataType: Reg_DWORD

The value specifies the size of the log file in bytes. The default value is 250000(decimal)/3d090(hexadecimal) which equals 250000 bytes (approximately 245 KB). To convert from kilobyte to bytes, multiply by 1024. To convert from megabytes to bytes, multiply by 1048576 (1024 x 1024).

An example of setting or changing CCMLOGMAXSIZE via a REG.exe command line would be:

REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxSize /t REG_DWORD /d 5242880 /f

In the above example command line, the log file size is increased to 5MB (5242880 bytes).

 

Note:

  1. Changing any of the above values changes the settings for ALL ConfigMgr client logs, not just the SMSTS.log.
  2. In Replace scenarios, the above changes would need to be done on the original/old computer.

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 manually restarting the SMS Agent Host service (CCMExec) or restarting the computer. The SMS Agent Host service can also be restarted via the following two command lines:

net stop ccmexec
net start ccmexec

When a Task Sequence first begins in the full OS either automatically via a mandatory/required deployment or manually via Run Advertised Programs/Software Center, it reads the current logging values from the above registry keys and assigns the following Task Sequence variables to those values:

_SMSTSLogDebug
_SMSTSLogEnabled
_SMSTSLogLevel
_SMSTSLogMaxHistory
_SMSTSLogMaxSize

The SMSTS.log then uses the values specified in the above variables to set its logging options. Since this is all done when the Task Sequence first starts, attempting to change the registry values after the Task Sequence has begun and is running will not change the logging options for the running Task Sequence. Additionally, because the above are read only variables, attempting to change their value during the running Task Sequence will also not work.

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. You may also run into similar permission issues when running the Reg.exe commands. 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.

Automating Changing SMSTS.log Settings in the Original OS

In order for modified log settings to take effect during a Task Sequence, the log settings need to be modified BEFORE the Task Sequence starts. In scenarios where the Task Sequence is started in WinPE, this is done via the SMSTS.ini file. However for Task Sequences that start in the full OS via Software Center/Run Advertised Programs or a Required/Mandatory deployment, the changes need to be done via modifications to the registry keys mentioned in the above section. When the Task Sequence starts, it will read the values from the above registry keys and then set those values as the log settings during the Task Sequence. The easiest way to achieve this is through a script which is run via the option “Run another program first” in the Properties of the Task Sequence

 

To automate modifying the SMSTS.log settings before the Task Sequence executes in the original OS:

  1. Open up Notepad and paste in the following lines:

    ConfigMgr 2007
    @echo off
    @echo Setting ConfigMgr Logging Registry Keys
    %windir%\system32\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxHistory /t REG_DWORD /d 3 /f
    %windir%\system32\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxSize /t REG_DWORD /d 5242880 /f
    %windir%\system32\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\DebugLogging" /v Enabled /t REG_SZ /d TRUE /f
    %windir%\system32\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogLevel /t REG_DWORD /d 0 /f


    ConfigMgr 2012/ConfigMgr Current Branch
    @echo off

    IF DEFINED PROCESSOR_ARCHITEW6432 (
    ECHO %PROCESSOR_ARCHITEW6432%
    @echo Setting ConfigMgr Logging 64bit Registry Keys
    %windir%\sysnative\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxHistory /t REG_DWORD /d 3 /f
    %windir%\sysnative\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxSize /t REG_DWORD /d 5242880 /f
    %windir%\sysnative\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\DebugLogging" /v Enabled /t REG_SZ /d TRUE /f
    %windir%\sysnative\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogLevel /t REG_DWORD /d 0 /f
    ) ELSE (
    @echo Setting ConfigMgr Logging 32bit Registry Keys
    %windir%\system32\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxHistory /t REG_DWORD /d 3 /f
    %windir%\system32\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogMaxSize /t REG_DWORD /d 5242880 /f
    %windir%\system32\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\DebugLogging" /v Enabled /t REG_SZ /d TRUE /f
    %windir%\system32\REG.exe ADD "HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL" /v LogLevel /t REG_DWORD /d 0 /f
    )

    If necessary, change the values in the above lines to the desired values.
     

  2. Save the file as TSLogging.cmd. When saving the file in NotePad, make sure it has the extension of .cmd and not .txt
     
  3. Create a Package and include the CMD script file created in Steps 1-2.
     
  4. For the Package created in Step 3, create a Program for the Package with the following command line:

    %windir%\system32\cmd.exe /c TSLogging.cmd
     
  5. Distribute the Package created in Step 3 to Distribution Points
     
  6. In the ConfigMgr console, navigate to:

    ConfigMgr 2007
    Site Database --> Computer Management --> Operating System Deployment – --> Task Sequences

    ConfigMgr 2012/ConfigMgr Current Branch
    Software Library --> Operating Systems --> Task Sequences
     
  7. Right click on the desired Task Sequence and choose Properties
     
  8. In the Properties of the Boot Image, click on the Advanced tab
     
  9. Under the Advanced tab, check the option Run another program first:
     
  10. Under the Run another program first option:

    • Next to Package:, click the Browse… button and select the Package created in Step 3.
    • Next to Program:, expand the drop down menu and select the Program created in Step 4.
    • Check the option Always run this program first
       
  11. Click on the OK button to save and close the Task Sequence Properties box.
     

A restart of the ConfigMgr client service (SMS Agent Host) is not needed because when the Task Sequence initiates, it will read the values of the registry keys directly to set the logging values for the Task Sequence. It does not read the values from the current ConfigMgr client session/environment.

IMPORTANT NOTE!
Except for In-Place Upgrade scenarios where WinPE is not used, the logging values used THROUGHOUT the Task Sequence is still initialized in WinPE. For this reason, even if extended logging is set in the original Windows OS, the section regarding WinPE and adding an SMSTS.ini file into the boot image should ALWAYS be followed. Not doing so may cause extended logging not to be enabled during the WinPE and newly installed Windows portions of the Task Sequence.

 

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.

The logging options and values that can be modified in the SMSTS.ini file are:

DEBUGLOGGING
ENABLELOGGING
LOGLEVEL
LOGMAXHISTORY
LOGMAXSIZE

The above value names are basically the same as the registry value names from the full OS, but without the preceding CCM prefix.

Similar to when the Task Sequence begins in the full OS, when the Task Sequence begins in WinPE, it reads the above values from the SMSTS.ini file and then assigns the values to the following variables:

_SMSTSLogDebug
_SMSTSLogEnabled
_SMSTSLogLevel
_SMSTSLogMaxHistory
_SMSTSLogMaxSize

The SMSTS.log then uses the values specified in the above variables to set its logging options. Since this is all done when the Task Sequence first starts, attempting to add an SMSTS.ini file or change its values after the Task Sequence has begun and is running will not change the logging options for that particular running Task Sequence. Additionally, because the above are read only variables, attempting to change their value during the running Task Sequence will also not work.

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 default values are used.

To modify the values, an SMSTS.ini file needs to be created with a [Logging] section that contains the parameters that need to be modified. The file then needs to be added to 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, increase the amount of rolled over/historical logs to 3, and enable debug logging, the following would be the contents of the SMSTS.ini file:

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

Notes

  1. The logging options in the SMSTS.ini file are case sensitive and should be entered in all uppercase.
  2. All values are specified in decimal.
  3. DEBUGLOGGING is enabled by setting the value to 1, not to TRUE as it appears in the Registry in the full OS.

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
    B
  • 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
    B
  • ConfigMgr 2012/ConfigMgr Current Branch
    <ConfigMgr_Install_Directory>\bin\x64

Notes

  1. The above directories are NOT the same directory that stores files that will be injected into the Boot Image.
  2. One osdinjection.xml file handles both x86 and x64 Boot Images.
  3. The majority of files in the above directories are not injected automatically into the Boot Image unless they are in the osdinjection.xml file. However some files in the above directories are injected automatically without the need to specify them in the osdinjection.xml file. An example of one files that is injected automatically without the need to edit the osdinjection.xml file is WinPEshl.ini. Starting in ConfigMgr 2012 SP2 CU1/ConfigMgr 2012 R2 SP1 CU1, the SMSTS.ini file is now also a file that is injected automatically so editing osdinjection.xml is no longer necessary. See Step 3 below.

 

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

  1. Using NotePad, create an SMSTS.ini file with the desired parameters. For example:

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


    When saving the file in NotePad, make to save it with an 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. If you are on ConfigMgr SP2 CU1/ConfigMgr R2 SP1 CU1 or newer (including ConfigMgr Current Branch), skip to Step 8. Manually editing of the osdinjection.xml file as detailed in Steps 4-7 is no longer needed in these versions. Starting with ConfigMgr SP2 CU1/ConfigMgr R2 SP1 CU1, the SMSTS.ini file is automatically injected into the Boot Image as long as it is put into the proper directory from Step 2.
     
  4. Once the SMSTS.ini file is copied to the appropriate directories on the ConfigMgr site server, navigate to the following directory:

    ConfigMgr 2007
    <ConfigMgr_Install_Directory>\bin\i386

    ConfigMgr 2012/ConfigMgr Current Branch
    <ConfigMgr_Install_Directory>\bin\x64
     
  5. Create a backup of the file osdinjection.xml located in the directory from Step 3
     
  6. 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 following lines:

      </FileList>

      </Architecture>
      <Architecture imgArch="x64">

      Add the following section immediately before the above lines but after the line containing </File>:

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

      so that it looks as follows:

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

      *Note: The above is being added to the end of the i386 Architecture section which immediately precedes the x64 Architecture section.
       

    • For the x64 Boot Image, find the following lines:

      </FileList>
      </Architecture>
      <Architecture imgArch="ia64">

      Add the following section immediately before the above lines but after the line containing </File>:


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


      so that it looks as follows:

      </File>
      <File name="smsts.ini">
      <LocaleNeeded>false</LocaleNeeded>
      <Source>bin\x64</Source>
      <Destination>Windows</Destination>
      </File>
      </FileList>
      </Architecture>
      <Architecture imgArch="ia64">

      *Note: The above is being added to the end of the x64 Architecture section which immediately precedes the ia64 Architecture section.
      B

  7. Save the osdinjection.xml file in NotePad.
     
  8. In the ConfigMgr console, navigate to:

    ConfigMgr 2007
    Site Database --> Computer Management --> Operating System Deployment --> Boot Images

    ConfigMgr 2012/ConfigMgr Current Branch
    Software Library --> Operating Systems --> Boot Images
     
  9. Right click on the desired Boot Image to be updated with the SMSTS.ini file and choose Update Distribution Points.
     
  10. In the Summary page of the Manage Distribution Points Wizard (ConfigMgr 2007)/Update Distribution Points Wizard (ConfigMgr 2012/ConfigMgr Current Branch) window, click on the Next > button and allow the Boot Image to be rebuilt.
     
  11. Once the Boot Image is finished rebuilding, in the Wizard Completed (ConfigMgr 2007)/Completion (ConfigMgr 2012/ConfigMgr Current Branch) page of the Manage Distribution Points Wizard (ConfigMgr 2007)/Update Distribution Points Wizard (ConfigMgr 2012/ConfigMgr Current Branch) window, click on the Close button.
     
  12. Repeat Steps 9-11 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.

Instead of using the above process, the SMSTS.ini file can be manually injected into the Windows directory of the Boot Image using ImageX or DISM. However using the above method 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 via the Setup Windows and ConfigMgr task, the MSI properties for CCMSetup can be used to set logging options for the SMSTS.log in the new Windows OS.

 

To set the SMSTS.log settings in the newly installed Windows OS:

  1. In the ConfigMgr console, navigate to:

    ConfigMgr 2007
    Site Database --> Computer Management --> Operating System Deployment --> Task Sequences

    ConfigMgr 2012/ConfigMgr Current Branch
    Software Library --> Operating Systems --> 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 the section Modify the registry in the original Windows OS. For example:

    CCMLOGMAXSIZE=5242880 CCMLOGLEVEL=0 CCMLOGMAXHISTORY=3 CCMDEBUGLOGGING=1

    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.
     
  7. Follow the section regarding WinPE and adding an SMSTS.ini file into the boot image. It is also necessary to follow the instructions in that section since logging values for the whole entire Task Sequence is initiated in WinPE. Not doing so will result in the values being implemented in this section not to activate until after the Task Sequence completes. Please make sure that the values specified between the different sections match.

In the example in Step 4 above, the SMSTS.log file size is set to 5MB, log level is set to the most verbose level, the amount of rolled over/historical logs is set to 3, and debug logging has been enabled.

IMPORTANT NOTE!
Except for In-Place Upgrade scenarios where WinPE is not used, the logging values used THROUGHOUT the Task Sequence is always initialized in WinPE. For this reason, even if extended logging is only needed in the newly installed Windows OS, the section regarding WinPE and adding an SMSTS.ini file into the boot image should ALWAYS be followed. Not doing so will result in extended logging not being enabled while the Task Sequence is running and instead will only be enabled AFTER the Task Sequence completes.

Additional Notes

  1. 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.
  2. DEBUGLOGGING is enabled by setting the value to 1, not TRUE as it appears in the Registry.
  3. 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.

 

Change Log

Update 2012-02-29

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

Update 2016-08-23 – 2016-08-26

  • Clarified that adding an SMSTS.ini to the Boot Image is always needed regardless of where issue is occurring. This is due to logging being initialized in WinPE for the whole entire Task Sequence
  • Added “quick links” to the start of the article and direct links throughout the article
  • Updated information regarding changes in logging starting in ConfigMgr 2012 SP2 CU1/R2 SP1 CU1 where the SMSTS.ini file is automatically injected so osdinjection.xml no longer needs to be manually modified
  • Added information on how to enable logging in scenarios where the Task Sequence is started in the full OS via Software Center or a mandatory/required deployment
  • Added notes about In-Place Upgrade scenarios
  • Updated to include information and links regarding ConfigMgr Current Branch
  • Corrected some formatting problems caused by update of blog site software

 

Frank Rojas
Senior Support Escalation Engineer

Comments (14)

  1. Anonymous says:

    Frank……great job.  You obviously know your stuff.  This is an excellent article with knowledge that will be very useful.  Thanks for your time and the knowledge transfer!

  2. Levi Stevens says:

    Frank, I would vote this the Blog of the YEAR!!! This is amazing stuff. Thanks!

  3. Frank Rojas says:

    The above article does also apply to ConfigMgr 2012 with one small change. The OSDInjection.xml file is in the x64 folder instead of the i386 folder. Also, there is currently a known issue in ConfigMgr 2012 that if starting the Task Sequence from the full OS (via Software Center or a required deployment), the Task Sequence will not honor any custom logging settings after it boots into WinPE. The issue is being fixed in CU5 for SP1 and CU2 for R2.

  4. Its a great work and good article shared taking care of logging options for smsts.log in all scenarios.
    Hats off to you Frank.

  5. Frank Rojas says:

    You are probably correct that that will work. I actually thought of putting exactly this information in the article, but there is one problem with this approach. Anytime you use the Restart Computer task with the option "The currently installed default operating system" in the full Windows OS BEFORE the "Setup Windows and ConfigMgr" task, the computer does not auto log back in. This in itself does not cause any technical problems because even if a user doesn't log in, the Task Sequence does continue in the background once the computer finishes rebooting and the SMS Agent Host service starts back up. However sometimes the Task Sequence visual progress is no longer displayed, even if a user logs in. This is not ideal, and may even be confusing to an end user.

    Additionally, there may be situations where the logging options need to be set before we have even had a chance to set the logging options via the Task Sequence. It's kind of like a chicken and egg problem.

    One of the things I considered adding was using the "Run another program first:" option under the Advanced tab in the Properties of the Task Sequence to set the appropriate registry keys. However it still would have a required a restart of the SMS Agent Host service, and I am unsure how that would affect the Task Sequence. Would a program run using "Run another program first:" option that restarted the SMS Agent Host service or restarted the computer cause the Task Sequence not to start after the program finished restarting the SMS Agent Host or computer? I am not sure, and it is the reason why I recommended using a method outside of the Task Sequence to set the registry settings.

    With that said, in Refresh/Replace scenarios, for the original/old OS, I see no problem with setting the logging options via registry settings in the Task Sequence itself as long as the limitations of doing so are known and understood (computer does not auto log back in/Task Sequence progress may not display again until the computer reboots into the WinPE portion of the Task Sequence).

  6. How about using Group Policy Preferences to standardize the settings across the enterprise?

  7. Anonymous says:

    Great article, and works for me. The only remark/tips I can give is that the osdinjection.xml file should be adapte/change on the server where the SMS_PROVIDER is installed (ConfigMgr 2012).

  8. JohanW says:

    Q:

    The text say "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."

    Surely we can do the change in the TS (running as system with full permission so writing to this values is not a problem) and then have a Restart Computer step back to the currently installed default OS?

    Wouldn't that work?

  9. Anonymous says:

    Change size of SMSTS.log

  10. Anonymous says:

    Pingback from OSD links | sccm road

  11. Ian Burnell says:

    Does this still apply for SCCM 2012 SP1 (with MDT 2012 integrated)?. I followed the above and then updated my MDT boot image but to no avail – I cannot see smsts.ini within winpe/F8

  12. Anonymous says:

    Pingback from Charlie’s Tech Ramblings » Blog Archive » Gleanings from Johan at TechEd 2014

  13. Anonymous says:

    I decided to write this brief blog to provide a link to another blog article by Frank Rojas that describes

  14. John Pine says:

    The log settings are not taking effect even though I see “Used smsts.ini to set logging settings” at the beginning of the log.

    I see this,
    Current LogMaxSize is saved to TS environment since it has not been saved before
    Current LogMaxHistory is saved to TS environment since it has not been saved before
    Current LogLevel is saved to TS environment since it has not been saved before
    Current LogEnabled is saved to TS environment since it has not been saved before
    Current LogDebug is saved to TS environment since it has not been saved before

    Instead of something like this,
    Setting LogMaxSize to 5242880
    Setting LogMaxHistory to 3
    Setting LogLevel to 0
    Setting LogEnabled to 1
    Setting LogDebug to 1

    Any ideas on what my be causing the log settings to not work?

    Thanks,
    John

Skip to main content