Copy CMTrace.exe into the Full Windows OS in a task sequence
\Scenario:
I often work with customers using operating system deployment. We usually end up using CMTrace.exe (Log viewing tool for ConfigMgr 2012) to troubleshoot or understand what's happening in the background.
This is really easy to do in WinPE (Windows PE) portion of a task sequence since CMTrace.exe is built into the boot image in ConfigMgr 2012 R2.
Once the task sequence installs the operating system, it will then reboot into the full operating system from WinPE. Viewing logs becomes a little more tricky now since CMTrace.exe is not built into any of our operating systems.
You would have to map a network drive to a location where CMTrace.exe is located to view logs in while running a task sequence after you are in the full OS.
Adding CMTrace.exe into the full OS:
I’m going to show an easy way to copy CMTrace.exe while still in WinPE phase of the task sequence to the volume where the OS WIM was applied.
We will use the “Run Command Line” step in the task sequence right after the “Apply Operating System” step. At this point of the task sequence, we are still in WinPE so we will have access to CMTrace.exe from the X: drive.
The command line we need to run is for x64 boot images: cmd /c xcopy x:\sms\bin\x64\CMTrace.exe %OSDTargetSystemDrive%\windows\system32\ /E /H /C /I /Q /Y
The command line we need to run is for x86 boot images: cmd /c xcopy x:\sms\bin\i386\CMTrace.exe %OSDTargetSystemDrive%\windows\system32\ /E /H /C /I /Q /Y
This is simply going to copy CMTrace.exe WinPE / X: drive to the volume where the OS WIM file was applied.
This will allow us to run CMTrace.exe when we get into the full OS portion of the task sequence or anytime after the task sequence is completed as well.
If you are running a “Build and Capture” task sequence it would probably make more sense to run this step during that instead of the deploy task sequence.
Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of any included script samples are subject to the terms specified in the Terms of Use
Comments
- Anonymous
January 01, 2003
thank you. - Anonymous
January 01, 2003
That is what this is doing. You could run this step in a build and capture as well to automate it. - Anonymous
August 07, 2014
I just drop it into the c:windowssystem32 on my reference image... ;) - Anonymous
April 03, 2015
Hi Justin, I adapted this into my task sequence but if I use the command 'cmd /c xcopy x:smsbinx64CMTrace.exe %OSDTargetSystemDrive%windowssystem32 /E /H /C /I /Q /Y' it seems that the TS is halted and in background the cmd.exe/xcopy command is actually waiting for confirmation if the destination is a folder to be created. - Anonymous
August 20, 2015
Thanks. Just works as demonstrated on the page. The prblem is that in sme versions of SCCM 2012 it looks like Ms has taken away the F8 feature. So once the new windows image has been applied you no longer have access to F8 command console. How does one get cmtrace console up and running ? - Anonymous
August 20, 2015
@Nalin I'm not aware of these changing to this command prompt works fine for me in the full OS part of the TS - Anonymous
August 27, 2015
To avoid halting the TS just add a "" at the end of "System32" like this: cmd /c xcopy x:smsbinx64CMTrace.exe %OSDTargetSystemDrive%windowssystem32 /E /H /C /I /Q /Y
Got the same problem with the halted TS and solved it. - Anonymous
October 05, 2015
Why use xcopy and not just copy? - Anonymous
November 13, 2015
Please note that this seems to have been dropped in R2 SP1 CU1 as my boot media no longer contains CMTrace.exe. I have had to add it manually to the boot media. - Anonymous
May 03, 2016
I'm having a problem with CMTrace.exe. When I copy to clipboard it is only copying around 17 lines. I have filtered a log file to 2600 or so entries. How do I get all of those copied over? - Anonymous
July 27, 2017
Another Manual process.Just keep the cmtrace.exe ready on a network share.Map a drive to this network share while running TS in Full OS.You now have the access to the cmtrace.exe which you can copy to another drive on system that is running the TS.Simply open the cmtrace.exe and hit File>>Open menu to navigate to the location of the required logs.