SCCM Configmgr 2012 How to make CMtrace tool as default log viewer for reading .log files for all users

 

This post is pending since long and finally has come out. CMtrace.exe (Configmgr guys favorite tool) is  log file viewer which is friendly ,lot more easier to files with .log extension .To know more about about cmtrace log and its benefits,  read Garth post here .

This tool can be downloaded from Configuration manager 2012 R2 tool kit http://www.microsoft.com/en-us/download/details.aspx?id=36213. Download and install the toolkit .After the install ,You will find CMTrace in C:\program files (x86)\Configmgr 2012 toolkit R2\clientTools.

Garth posted blog on How to install CMTrace using application model here .In this post,Garth explained ,how to copy the CMtrace tool to  C:\windows\system32 and from there you can double click this tool to read .log files .

In my post,I will show you,how to make this tool as default log viewer for all users  without the need of going to system32 and double click cmtrace.exe .

This process consists of 2 applications (both share common source) ,each with one deployment type. The reason for choosing 2 applications is because one app is for Computer (to copy cmtrace.exe) and other is for User to set default log viewer.

I did not try the method by creating single application with 2 deployment types  ,1 copy cmtrace to computers and other for users that does the registry key changes .If you would like to try this method and if it works, drop your solution using the comments section.

Before we start creating applications,download the source files from here. This zip file contains 3 files 1)CMtrace (5.00.7958.1000) 2) Copy_CMTrace.bat 3) Set_CMtrace_Default_Log_Viewer.bat.

We will use the same content (zip file) to create 2 applications to achieve this task.

So first create application 1) Copy CMtrace using Garth blog post but don’t create any deployment ,just only application with deployment type. Distribute to DP’s.

After you are done with Garth post,you will see something like below with application and its deployment type.

image

Now lets create Application 2) CMTrace Default Log Viewer .Creation of the application with script as deployment is similar to other applications you normally create but one thing you need to look at is ,detection method  which is given below.

Right Click and choose create application

image

Select manually specific application information

image

Enter the application Name

image

You can configure this section as you need else click next

image

Click Add Deployment Type

image

select manually specific the deployment type information

image

Enter the Deployment Type Name

image

Select the content location and installation program as shown below .

image

Click on Add clause

image

Use the following for detection rule:

Setting Type:Registry

Hive:HKEY_CURRENT_USER

Key:Software\Classes\Log.File\shell\open\command

DataType: string

Value:C:\Windows\system32\cmtrace.exe "%1"

Click OK

image

Click Next

image

User Experience tab ,select Installation behavior : Install for User ,Visibility:Hidden and maximum run time:15 min

image

Requirement Tab ,click next unless you have any requirements to check before it install

image

For Dependencies tab ,we will now add the Copy CMTrace that we created using Garth blog post

Click add Add under dependencies tab

image

Enter name and click on Add ,select the copy CMtrace script

image

Click Next

image

Review Summary Page

image

Click Next ,next ,next

Distribute the application to distribution points ,monitor the status.

with this ,we have now created 2 applications with its deployment types and we are now ready to deploy to users.

We will now deploy the application (Set CMTrace Default log Viewer) to user based collection ONLY.

Right click on Set CMTrace Default log Viewer application and select deploy

image

select the User based collection

image

click next for the distribution points

deployment settings ,action: Install and Purpose:Required

image

select the scheduling time

image

User experience ,choose what you need

image

click next ,next next for the completion

image

Now ,let the user who is member of the deployed collection login to any client ,he/she will be able to open the .logs using cmtrace as default log viewer.

Results:

On User PC, initiate user policy retrieval from configuration manager applet,control panel ,wait for couple of min for client to download and execute the policy. Go to C:\windows\ccm\logs ,open any of the log, you will see the log file open automatically using cmtrace.

clip_image001[4]

Thanks to Jay(happysccm) for providing the fix to suppress the above window (HKCU\Software\Microsoft\Trace32] "Register File Types"="0" )

scripts are updated with above registry setting.

Summary:

We created 2 applications 1) for computer and 2) for user ---first app as dependency to this application and deploy to user collection.

Hope you enjoyed this article and helpful too!

5 Responses to "SCCM Configmgr 2012 How to make CMtrace tool as default log viewer for reading .log files for all users"

  1. I know you posted this over a year ago but.... I just cannot get it to detect on the HKCU key. I've combined both your instructions and Garth's instructions in to one app using the Powershell App Deploy Toolkit so that I could write the HKCU keys to each user (plus default). It installs fine, the keys are written to the correct location but on my detection it refuses to even detect on the existence of the Software\Classes\Log.File\shell\open\command key. If I remove the detection on the key and only use a detection on the existence of cmtrace it detects fine. Any ideas?

    Reply

Leave a Reply