Enable Debug and Verbose Logging in Windows PE in Configuration Manager 2012
Overview:
In this post, I'm going to show an easy method to enable Debug and Verbose logging within the Windows PE portion of a task sequence. When troubleshooting a task sequence with the default logging, the logs may be overwritten and lost due to log size and max log history. Enabling Debug and/or verbose logging can help in the Windows PE portion of the task sequence.
Update: In Configuration Manager 2012 SP2/SP1 R2 CU1 or later you can simply place the smsts.ini file in the <ConfigMgr Install Dir>\OSD\bin\<Architecture> folder and it will automatically be injected into the boot image corresponding to the <Architecture> folder you placed the smsts.ini into. You don't have to edit the osdinjection.xml.
Steps:
(Note: You should use the Update section above to do this since it's much easier.)
Step 1. Create a file names smsts.ini that contains the following text in it:
[Logging]
LOGLEVEL=0
LOGMAXSIZE=524288000
LOGMAXHISTORY=3
DEBUGLOGGING=1
Note: Enabling debug logging (Bottom two lines) may be more logging output than needed in most troubleshooting scenarios. If you simply want to increase the log size and log history, you could even remove line 1 that sets the LOGLEVEL to 0 (Verbose Logging).
LOGLEVEL
Specifies the amount of detail to write to System Center 2012 Configuration Manager log files. Specify an integer ranging from 0 to 3, where 0 is the most verbose logging and 3 logs only errors. The default is 1.
LOGMAXSIZE
Specifies the maximum log file size in bytes. When a log grows to the size that is specified, it is renamed as a history file, and a new file is created. This property must be set to at least 10000 bytes. The default value is 250000 bytes. 524288000 used in this setting above is 50MB
LOGMAXHISTORY
When a System Center 2012 Configuration Manager log file reaches 250000 bytes in size (or the value specified by the property CCMMAXLOGSIZE), it is renamed as a backup, and a new log file is created.
DEBUGLOGGING
Enables debug logging. Values can be set to 0 (off) or 1 (on). The default value is 0. This causes the client to log low-level information that might be useful for troubleshooting problems. As a best practice, avoid using this property in production sites because excessive logging can occur, which might make it difficult to find relevant information in the log files..
Step 2. Create a folder named "Custom" in the <ConfigMgr Install Dir>\OSD folder and copy the smsts.ini file into the Custom folder.
Step 3. In order for the Debug logging to work in Windows PE, we need the smsts.ini file in the Windows directory of the boot image. The easiest way to do this is by using the osdinjection.xml (<ConfigMgr Install Dir>\bin\X64\osdinjection.xml). This is the file that determines what additional files will be added the boot image when updating/importing a boot image in Configuration Manager.
Step 4. Open up the osdinjection.xml with notepad (You may need to run notepad as Administrator if UAC is enabled)
There will be two sections in the osdinjection.xml that will need to be updated if you want to enable Debug logging on x86 and x64 boot images:
To add smsts.ini in x86 boot images you will need to add the red text in the i386 section (Note: there will be a lot in files that are being added in this section):
<Architecture imgArch="i386">
<FileList source="WPE">
<File name="smsts.ini">
<LocaleNeeded>false</LocaleNeeded>
<Source>Custom</Source>
<Destination>windows</Destination>
</File>
</FileList>
</Architecture>
To add smsts.ini in x64 boot images you will need to add the red text in the x64 section (Note: there will be a lot in files that are being added in this section):
<Architecture imgArch="x64">
<FileList source="WPE">
<File name="smsts.ini">
<LocaleNeeded>false</LocaleNeeded>
<Source>Custom</Source>
<Destination>windows</Destination>
</File>
</FileList>
</Architecture>
Step 5. Once the XML is updated, the next time the boot image is updated the smsts.ini will be injected into the windows directory of the boot image.
You can verify the smsts.ini exist when you are in Windows PE next time:
You should also see the following lines in the smsts.log in %temp%\smstslog\smsts.log
Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of any included script samples are subject to the terms specified in the Terms of Use
Comments
- Anonymous
September 04, 2015
Based on your update, I'm thinking the best way to do this in SCCM 2012 R2 SP1 would be to copy the smsts.ini file to the OSDboot folder. Just to clarify, is that all that needs done? Also, does this go to the root of that boot folder or within the i386 and/or x64 folders? - Anonymous
December 16, 2015
For SCCM 2012 SP2 or SCCM 2012 R2 SP1 you should place the smsts.ini file in the OSDBin folder for it to be automatically included in the boot image. - Anonymous
January 17, 2016
I've just tried the new SCCM 2012 R2 SP1 / 2012 SP2 method and you need to place the smsts.ini file into the "OSDBinx64" and "OSDBini386" directories for it to be automatically injected into the boot images.