See all of the top support solutions for our most common issues here
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:
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:
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:
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:
The above parameters are described in the following TechNet article:
About Configuration Manager Client Installation Propertieshttp://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:
ConfigMgr 2007 32bit OSes and all ConfigMgr 2012HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\DebugLogging!Enabled ConfigMgr 2007 64bit OSesHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\CCM\Logging\DebugLogging!Enabled
A STRING value of TRUE enables debug logging. Deleting the DebugLogging key disables debug logging.
ConfigMgr 2007 32bit OSes and all ConfigMgr 2012HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL\debuglogging!LogEnabled ConfigMgr 2007 64bit OSesHKEY_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).
ConfigMgr 2007 32bit OSes and all ConfigMgr 2012HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL!LogLevelConfigMgr 2007 64bit OSesHKEY_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.
ConfigMgr 2007 32bit OSes and all ConfigMgr 2012HKEY_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.
ConfigMgr 2007 32bit OSes and all ConfigMgr 2012HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL!LogMaxSizeConfigMgr 2007 64bit OSesHKEY_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 ValueCannot 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:
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:
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:
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:
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:
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:
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 RojasSupport Escalation Engineer