Today, I’d like to introduce you to a new Tool, on which I was working for the last few weeks. The main purpose of the Tool is to automate CMTrace, CMLogViewer and OneTrace to open relevant log files instantly from Remote Computers. For me this Tool is a huge Timesaver when troubleshooting Client side issues in ConfigMgr. The Tool is based on PowerShell and is called “ConfigMgr LogFile Opener”
You can download the latest version of the tool on GitHub.
Getting CMTrace
CMTrace can be found in the Installation folder on the Configuration Manager Primary Site Server.
Example: D:\Microsoft Configuration Manager\CMTrace.exe
It is also available on every system, where the ConfigMgr Client is installed:
C:\Windows\CCM\CMTrace.exe
Getting CMLogViewer
CMLogViewer is part of the Configuration Manager Support Center. The Setup can be found in the Installation folder on the Configuration Manager Primary Site Server.
Example: D:\Microsoft Configuration Manager\tools\SupportCenter\supportcenterinstaller.msi
After installation, the binary can be found at:
C:\Program Files (x86)\Configuration Manager Support Center\CMLogViewer.exe
Getting OneTrace
OneTrace is part of the Configuration Manager Support Center. The Setup can be found in the Installation folder on the Configuration Manager Primary Site Server.
Example: D:\Microsoft Configuration Manager\tools\SupportCenter\supportcenterinstaller.msi
After installation, the binary can be found at:
C:\Program Files (x86)\Configuration Manager Support Center\CMOneTrace.exe
Parameters
Below is a list of possible parameters. Note that the list below always reflects the latest version of ConfigMgr LogFile Opener. Some Parameters might no be available in older releases.
As of now, all Parameters are optional and can be used to change the default behaviour of ConfigMgr LogFile Opener.
Parameter | Description |
---|---|
-Hostname | Can be used for a direct connection to a client device. Otherwise the Tool will prompt you to specify the Hostname |
-CMTrace | Can be used to specify a different location for CMTrace.exe. The Tool will look by default at “C:\Windows\CMTrace.exe” |
-CMLogViewer | Can be used to specify a different location for CMLogViewer.exe. The Tool will look by default at “C:\Program Files (x86)\Configuration Manager Support Center\CMLogViewer.exe” |
-OneTrace | Can be used to specify a different location for CMPowerLogViewer.exe. The Tool will look by default at “C:\Program Files (x86)\Configuration Manager Support Center\CMOneTrace.exe” |
-ClientLogFilesDir | Can be used to specify a different location for the ConfigMgr Client LogFiles. e.g. ‘c$\Program Files\CCM\Logs’ |
-ActionDelayShort | Can be used to specify the amount of time in milliseconds, the Script should wait between the Steps when opening multiple LogFiles in GUI Mode. Default value is 1500 |
-ActionDelayLong | Can be used to specify the amount of time in milliseconds, the Script should wait between the Steps when opening multiple LogFiles in GUI Mode. Default value is 2500 |
-LogProgram | Can be used to specify which Log Program should be active when the tool is starting. Possible values are “CMTrace, “CMLogViewer” and “OneTrace”. Default value is ‘CMTrace’ |
-LogProgramWindowStyle | Can be used to specify the WindowStyle of CMTrace and File Explorer. Possible values are “Minimied”, “Maximized” and “Normal”. Default value is ‘Normal'” |
-DisableHistoryLogFiles | If specified, the Tool won’t open any history log files |
-RecentLogLimit | Can be used to specify the number of recent log files which will be listed in the menu. Default value is 15″ |
-DisableUpdater | If specified, the Tool won’t prompt if there is a newer Version available |
-EnableAutoLogLaunch | If specified, the Tool will automatically open the corresponding logs when executing client actions |
Parameter Example:
Directly connect to ‘PC01’, with the LogFiles available at ‘c$\Program Files\CCM\Logs’ and CMTrace being displayed maximized:
.\ConfigMgr_LogFile_Opener.ps1 -Hostname 'PC01' -ClientLogFilesDir 'Program Files\CCM\Logs' -LogProgramWindowStyle 'Maximized'
Using the Tool
Using the Tool is pretty straight forward. First, download the Tool from the Link above and launch it in PowerShell. Enter the Name of the Computer, on which you want to display the logfiles from.
You can now select from the below Actions. Currently Actions 1-19 open log files and Actions 50-54 will open file explorer to manually view some log related folders.
Using Action 93, you can view and open single LogFiles based on their Modify Date.
Using Action 96, you can execute many different actions on the connected Device, like updating the Machine Policy for example.
Using Action X, you can view the Tool Options. Here you can modify Options like the LogProgram to cycle between CMTrace, CMLogviewer and OneTrace. You can also install or remove the ConfigMgr Console Extension and the PendingReboot PowerShell Module.
Using the Console Extension, you can directly start ConfigMgr LogFile Opener and connect to the selected device from the ConfigMgr Console.
Below, you can see an older version of the tool in action.
Click on the above image to start the Playback.
Let me know in the Comments below or on Twitter, if you have any suggestions for extending the Tool. 🙂
Thats Amazing. Thanks will share more info on this once used.
Is it looking by defualt in c:\windows\ccm folder?
I have current branch installed and log are in the C:\Program Files\Microsoft Configuration Manager\Logs folder?
Hi Michael
Yes, in Version 1.0.0 it always looks in C:\Windows\CCM\Logs. I will add a Parameter to specify the logs directory in Version 1.1.0. For know you need to edit the Paths inside the Script.
Best Regards,
Simon
Is there a way this could be set up to use a specific account. Our CM Admin accounts don’t have access to the client machines. It would even be cool if the user id and password could be stored someplace securely so the log viewer user does not even need to know it.
another nice to have would be able to open logs from other locations – like Adaptiva, 1E or WindowsUpdate
Cool tool.
Thanks
Thanks for the great feedback. Providing different Credentials will be tricky, because of the way CMTrace interacts with PowerShell. But I see if I can do anything in a future build.
WindowsUpdate.log is already integrated in Version 1.1.0. Can you get me the Locations and Logfiles of Adaptiva and 1E?
Thanks for your work. I will look at the script because it’s something I was looking for.
Personally, I would set “cmtrace.exe” to the %Windir%\System32\ directory, because this is the first entry in the path variables.
But I saw that there is a parameter to customize this 😉
Thanks for the feedback. Puting CMTrace in C:\Windows is an old habit of mine, which is the reason why I specified it as the default location. But as you said, you can overwrite it by using the “-cmtrace” Parameter.
Thanks for the tool. I am trying to test it on local host. I am getting a message that local device name “dvdvd” has been assigned. And then an error that device is not accessible.
Running the sript from powershell as administrator.
What am i missing?
Hey Mike. If you just press enter at the first Screen, the Tool will use your local device for opening log files. Even though you use a local device, the Tool will connect to the C$ Share. In your case, this would be “\\dvdvd\c$”. If this share isn’t accessible, you’ll get the mentioned error.
I have tested this tool, it is working fine and i appreciate your efforts.
Please to understand how we can use this tool remotely and club with SCCM console.
Thanks 🙂 You can integrate it in the ConfigMgr Console by installing the Console Extension in the Settings Menu (x).
Hi, very nice tool, thanks for sharing it. Unfortunately I can’t connect to any system without dropping the firewall. Is there a specific firewall configuration required to allow this to work?