Living Table of Contents
- MDT Tutorial: Prologue & Requirements
- MDT Tutorial Part 1: Installation
- MDT Tutorial Part 2: Initial Configuration
- MDT Tutorial Part 3: Imaging
- MDT Tutorial Part 4: CustomSettings.ini
- MDT Tutorial Part 5: Bootstrap.ini
- MDT Tutorial Part 6: Customizing Boot Media
- MDT Tutorial Part 7: Customizing Base MDT Template & ADK WinPE Template WIM
- MDT Tutorial Part 8: Unattend.xml
- MDT Tutorial Part 9: Logging
- MDT Tutorial Part 10: CustomSettings.ini Validation Testing & Troubleshooting Part 1
- MDT Tutorial Part 11: Troubleshooting Part 2: Windows could not parse or process unattend answer file [C:\windows\Panther\unattend.xml] for pass [specialize]. The answer file is invalid.
- MDT Tutorial Part 11: Troubleshooting Part 3: Windows could not parse or process unattend answer file [C:\windows\Panther\unattend.xml] for pass [specialize]. The answer file is invalid.
- MDT Tutorial Part 11: Troubleshooting Part 4: Task Sequence Variable is Being Overwritten
- MDT Tutorial Part 11: Troubleshooting Part 5: Invalid DeploymentType value “” specified. The deployment will not proceed.
- MDT Tutorial Part 11: Troubleshooting Part 6: Unable to mount the WIM, so the update process cannot continue
- MDT Tutorial Part 11: Troubleshooting Part 7: Non-Fatal OSD Errors & Warnings
- Centralized Logging
- Enable Logging
- Log Locations
At some point you’re going to run into a problem with your imaging process and knowing where to look to get some answers is going to be paramount.
- There’s a lot on this topic – search!
I prefer to keep logs in a central location so they’re easy to find when needed, and for that, we’ll create a new share on our MDT server. Run the below from the MDT server.
New-Item -Path "C:\DeploymentShare\TSLogs" -ItemType directory New-SmbShare -Name "TSLogs$" -Path "C:\DeploymentShare\TSLogs" -FullAccess Administrators
Open your CustomSettings.ini and find a suitable place to add the entries for
SLShareDynamicLogging depending on your preferred scenario. Either is fine, just depends on your preference and environment.
Hard Coded Path
Set Logging via Task Sequence
Alternatively you could add steps to the Task Sequence itself to set those variables to their appropriate values, be it hard coded or relative.
You can get pretty creative, and for automated deployments, I usually default to something like this:
This way I can see what Task Sequence a particular machine ran.
But, to each their own.
SLShare vs SLShareDynamicLogging
Both values do different things:
- When the
SLShareproperty is set, MDT will copy the deployment logs to that location in a directory named after the computer, pulled from the %OSDComputerName% Task Sequence property (aka variable). So if you named your machine PC-1511amd64 the full path to find the logs will be \\MDTServer\TSLogs$\PC-1511amd64.
SLShareDynamicLoggingproperty is used for real-time debugging as ALL MDT logs will be written to that file during the Task Sequence. It will create a file named BDD.log in the specified directory which means if you set SLShareDynamicLogging it to \\MDTServer\Logs you’ll find a file named BDD.log in that directory. This obviously presents a problem if multiple machines are being imaged at the same time: they’d all be logged in the same file which might make it challenging to follow along. This is why I recommend appending
\%OSDComputerName%to the path so that the BDD.log is in the ‘correct’ directory.
For our purposes, you can leave this property enabled, but please note this enabling SLShareDynamicLogging does add a bit of overhead, so in a production environment:
- Only enable it when actually actively troubleshooting an issue and
- Ideally have it log to a location close to the machine being imaged versus a remote server to avoid traversing the WAN
Putting It All Together
With the CustomSettings.ini updated, image a machine and check your log directory for a folder structure:
- The %OSDComputerName% directory is an artifact caused by the fact that the property (or variable)
OSDComputerNamewasn’t set at the time the SLShareDynamicLogging property was processed in the CustomSettings.ini. In my production environment, I have logic in the CustomSettings.ini to properly name the machine based on specific criteria so that by the time we get to the area where SLShareDynamicLogging is assigned, the OSDComputerName property (aka variable) is set resulting in properly named directories. However in our lab, this logic doesn’t exist (yet), hence why that directory exists. To fix this, just add something like
OSDComputerName=LAB-%SerialNumber%to your CustomSettings.ini and please note that the OSDComputerName property (variable) does not need to be declared.
- The other directory is the correct directory and it contains the BDD.log that’s actively being updated.
While a machine is imaging, open the BDD.log (in the latter directory mentioned above) with CMTrace from your MDTServer (or whatever machine you’re working on) and you will see live updates:
When the Task Sequence is finished go back into the log directory for that machine and you will to find the logs that were copied up by MDT:
MDT Logs can be a little challenging to locate initially so I recommend you study up those links mentioned in the recommended reading section above.
- In WinPE & the disk is NOT partitioned:
- In WinPE & the disk IS partitioned:
- X:\MININT\SMSOSD\OSDLOGS (very small amount)
- In WinPE & Task Sequence is running
- smsts.log will be in X:\Windows\Temp\SMSTSLog
- All other logs will be in their respective directories mentioned above
- In Windows & Task Sequence is running
- smsts.log will be in C:\Users\Administrator\AppData\Local\Temp\SMSTSLog
Keep in mind there are other non-MDT logs you’ll probably need to review that are not listed here.
You now have some historical data to dig into if something goes wrong, which will hopefully be few & far in between!
Good Providence to you!