I love a good logfile and operating system deployment (OSD) has a whole bunch of useful logs. The log files created during OSD are vital for troubleshooting. I come across many customers who get several OSD failures in remote sites, they really battle to troubleshoot the issues and it can be challenging to get hold of the logs.
The Microsoft Deployment Toolkit (MDT) has a great script that can save loads of time, zticopylogs.wsf. Using the task sequence variable SLShare and this script you can get the OSD logs copied to a network share when a build failures or when a build completes.
The process below copies the log files from C:\Windows\CCM\Logs\SMSTSLog to the location set by SLShare and the domain join logs from C:\Windows\Pather folder.
I find it really useful to also have a few other log files copied to the SLShare location. By copying the following log files to C:\Windows\CCM\Logs\SMSTSLog before the Copy Logs task sequence step the logs will be copied to the SLShare for review and troubleshooting.
I tend to use a single central network share on the Primary or CAS. The share will need to writeable by the everyone built-in group.
Set the first group of the task sequence to continue on error, this will ensure that if the task sequence fails the logs will get copied.
Set the SLShare variable that is used by the zticopylogs script.
The deployroot variable is create by this step and the scripts are copied to C:\_SMSTaskSeqeunce\WDSPackage
The group will only run if there was a task sequence failure.
This command line will copy the useful logs to C:\Windows\CCM\Logs\SMSTSLog
Cmd /c copy C:\Windows\CCM\Logs\AppEnforce.log C:\Windows\CCM\Logs\SMSTSLog\ & copy C:\Windows\CCM\Logs\AppDiscovery.log C:\Windows\CCM\Logs\SMSTSLog\ & copy C:\Windows\CCM\Logs\ExecMgr.log.log C:\Windows\CCM\Logs\SMSTSLog\
Runs the command: cscript "%deployroot%\scripts\zticopylogs.wsf"
A folder is created using the OSDComputerName variable and the logs are copied in.