Find errors quickly in a SCCM or MDT log file.

I have an automated system to build out my Windows Images locally, 9 images in total using MDT 2013 U1 Beta Litetouch

  • Windows Server 2008 R2
  • Windows Server 2012 R2
  • Windows Server Technical Preview 2 (build 10074)
  • Windows 7 SP 1 – Both x86 and x64
  • Windows 8.1 Update 3 – Both x86 and x64
  • Windows 10 Build 10074 – Both x86 and x64

But I wondered today if everything was *really* going as well as I thought… The recommended way to check is to open the bdd.log file in cmtrace.exe and look for any Yellow or Red lines, warning and Errors!

SCCM and MDT use a special logging format so it’s pretty easy to search for errors using a script.

In powershell I can type in:

gci -recurse bdd.log | gc | Select-String "type=""(2|3)"""

I didn’t like the output, as it only returns the error line, without the file and line number, so I started to play around the script, and noticed that by removing the “get-content” command, Select-String did the right thing and opened the file in question

gci -recurse bdd.log | Select-String "type=""(2|3)"""

Yea! it worked, and found errors… :^)

Now I have to fix the errors. :^(

4 thoughts on “Find errors quickly in a SCCM or MDT log file.

  1. You could go a step further and filter for anything with ‘error’ or ‘warning’ in the log, sometimes those lines do not get marked as error/warning lines. I don’t think it would be too hard to recreate what cmtrace can do via PowerShell.

    • Generally I dislike the feature in Cmtrace where it will highlight lines with the string “error” or “warning”, since MDT and SCCM have a way to mark which lines are actually errors and warnings through the Type

  2. Pingback: How to Quickly Retrieve Errors from OS Deployment Logs with PowerShell | smsagent

Leave a comment