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.
(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:
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).
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.
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
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.
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):
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):
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