Menu
CCMEXEC.COM – Enterprise Mobility
  • Home
  • General
  • Configuration Manager
  • Windows 10
  • Windows 11
  • Intune
  • GitHub
  • About
CCMEXEC.COM – Enterprise Mobility

Make CMTrace the default log viewer using PowerShell

Posted on November 29, 2018November 29, 2018 by Jörgen Nilsson

Now that CMTrace is a part of the Configuration Manager client which is really great!, I still miss the fact that it is not made the default .log reader. It will save me at least 3 clicks 😉 on each machine I troubleshoot.

Here is a simple PowerShell script that will associate .Log and .Lo_ with C:\Windows\CCM\CMtrace.exe.

It also have an ActiveSetup that will add the registry key and value to remove the initial question shown below to make it the default reader for log files which really isn’t a real problem but still nice to remove.

It can be run as a script, program or in a Task Sequence to associate the .Log and .Lo_ with CMTrace.

It can be downloaded from here: CmtracePS

Let’s save 3 clicks!

15 thoughts on “Make CMTrace the default log viewer using PowerShell”

  1. Chris Lewis says:
    November 30, 2018 at 11:30 pm

    Great script… hope you don’t mind that I made a few tweaks to it… we really try to avoid ActiveSetup in our environment so we have an easy workaround by mounting the user profiles for all users on the computer and inserting the key using the reg add command. My edited script credits you with the original.. feel free to use as needed.

    Chris

    Reply
    1. Matheen says:
      November 20, 2019 at 5:35 pm

      Do you have the edited script to add it to default profile please Chris?

      Reply
  2. Jesus Octavio says:
    December 12, 2018 at 3:05 am

    Hi Jorgen first can I deploy in MDT cmtrace.exe and after can I apply this script in my TS ? during my deployments

    Reply
    1. Chris says:
      April 2, 2019 at 6:11 pm

      Yes, you can. I added it at the end of my task sequence. Make sure you have a step that copies CMTrace to the local host (if it’s not already in the image).

      Reply
  3. Rene says:
    April 17, 2019 at 8:19 am

    Hi

    the script doesn’t work with Server 2016

    the default viewer ist notepad 🙁

    Reply
    1. Jeff says:
      July 22, 2019 at 10:29 pm

      Worked fine for me on Server 2016. Great script!

      Reply
  4. Sam says:
    February 10, 2021 at 3:33 pm

    Hi,
    We have been using this for a while for 1909 now but it appears to no longer work when we move onto 20H2.
    Is this an issue you or anyone else has experienced. If so do you have any idea why?

    Reply
    1. Jörgen Nilsson says:
      February 15, 2021 at 8:56 am

      Hi,
      Most likely that MS clears all manually added items to the Activesetup regkey, I will update it as soon as I have time..
      Regards,
      Jörgen

      Reply
  5. Yogesh Gupta says:
    April 29, 2021 at 2:59 am

    For 20H2 i was able to set default viewer using a combination of this script as well run default app associations from a reference system

    Reply
  6. Pingback: Set CMTrace as Default Log File Viewer – SCCM PowerShell
  7. Steve Campbell says:
    August 19, 2021 at 7:04 pm

    Hi Jörgen Nilsson
    Found an extra ‘.’ in the script. Seemed to fix issues.

    Reply
  8. Joshua Ramos says:
    November 6, 2021 at 11:19 pm

    On Windows 20H2 it doesn’t seem to work. Do you have a preview of the script update please?On Windows 20H2 it doesn’t seem to work. Do you have a preview of the script update please?

    Reply
  9. Marc-Paul Pichel says:
    November 15, 2021 at 7:44 am

    Great script, thanks for sharing Jorgen.

    Reply
  10. Elshaday says:
    March 15, 2022 at 4:05 pm

    Hi Guys, I am upgrading from 1909 to 21H2 and this script doesn’t work for the log file assoc.
    does any one have that works please?
    It is indeed a great start and thank you so much.

    Reply
  11. Greg says:
    August 2, 2023 at 4:50 am

    I used it for a server 2022 task sequence and it worked as it says on the wrapper. I see this being useful for other apps too. Great work Jörgen

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

My name is Jörgen Nilsson and I work as a Senior Consultant at Onevinn in Malmö, Sweden. This is my blog where I will share tips and stuff for my own and everyone elses use on Enterprise Mobility and Windows related topics.
All code is provided "AS-IS" with no warranties.

Recent Posts

  • Tip when troubleshooting unexpected reboots during Autopilot – event ID 2800
  • New settings in Intune Security Baseline Windows 11 24H2 -2504
  • Managing extensions in Visual Studio Code
  • Reinstall a required Win32app using remediation on demand
  • Administrator protection in Windows 11 – First look
©2025 CCMEXEC.COM – Enterprise Mobility | WordPress Theme by Superb Themes
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Reject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT