I wrote a blogpost on how to make CMTrace which is included in the SCCM client nowadays using a PowerShell script. I got a question basically instantly if that could not be used for Intune managed clients without the SCCM client. Yes! it can, we only need to add a line to copy CMTrace.exe to C:\Windows for instance. And we should of use the best log reader there is when troubleshooting Intune Managed devices as well.
CMTrace is not free, it is included with the Configuration Manager license, which still is valid for use with Intune as Intune includes Configuration Manager CAL(double-check this as some M365 licenses do not) as well.
I also added a simple script to remove CMTrace.exe and the ActiveSetup that we created during install, we maybe want to do that one day.
Start by downloading the script form here: CmtraceIntune.zip
Then download the Win32appUtil from GitHub if you don’t have it already: https://github.com/Microsoft/Intune-Win32-App-Packaging-Tool
- Extract the CmtraceIntune.Zip file to C:\Temp\CMTraceIntune for example.
- Copy CMTrace.exe from a computer running the Configuration Manager client to C:\Temp\CMTraceIntune
- Use the Win32AppUtil.exe that was downloaded earlier to create a Win32App package that can be uploaded to Intune. For example, with the following information:
- Create a new Win32App in Intune with the following program settings. For a detailed guide on how to create a Win32App in Intune check out this post: https://ccmexec.com/2018/10/intune-win32-app-deployment-a-gamechanger/
- As detection method the following can be used.
Then we are ready to deploy the newly created application using Intune and when installed .Log and .Lo_ files are associated with CMtrace
Awesome idea. Quick observation: The last line in the install script has an extraneous forward slash just after “Register File Types” in the double quotes.
The slash breaks intended functionality of removing the question CMTrace asks.
Well spotted! thank you!
Updated the download now.
Regards,
Jörgen
The registry keys are not being written when deployed via intune. Using Win 10 Enterprise 1903. has the ability to write to the registry via Powershell “IntuneApps” been disabled?