Copy SMSTS Logs During Task Sequence

One simple way to improve the workflow of your MECM OSD is to setup automatic uploads of task sequence logs on success or failure. This can be accomplished very easily using A Square Dozen’s Building a Better Task Sequence to provide error handling logic in your task sequence.

Once you have your error handling task sequence setup, simply add two steps in both your “Success” and “Failure” blocks:

  • Connect to Network Folder (Mount Network Logs Folder)
    • Mount the location you wish to store the logs in.
    • For example, mount \\network-share.contoso.com\MECM\Logs to L:
  • Run Command Line (Copy Logs to Network Share)
    • cmd.exe /c copy %SMSTSLogPath%*.* L:\smsts%_SMSTSMachineName%.log

Ensure that you run the mount and copy steps before the “Error Dialog” step, and enable “Continue on error” to prevent any network issues from blocking the error dialog.

That’s it! Now your SMSTS logs will be uploaded to your network share on error or success.