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 and CMLogViewer 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”
Due to licensing, I can’t included CMTrace in this Tool. Checkout Johan’s blog post to get more details on this topic.
CMLogViewer is part of the System Center 2012 Configuration Manager Support Center.
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.
|-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”|
|-ClientLogFilesDir||Can be used to specify a different location for the ConfigMgr Client LogFiles. e.g. ‘c$\Program Files\CCM\Logs’|
|-DisableLogFileMerging||Can be used to prevent CMTrace from merging multiple LogFiles. The ‘Window’ Menu has to be used to toggle between the different LogFiles.|
|-WindowStyle||Can be used to change the Window Mode of CMTrace and File Explorer. Possible values are ‘Minimized’, ‘Maximized’ and ‘Normal’.|
|-CMTraceActionDelay||Specify the amount of time in milliseconds, the Script should wait between the Steps when opening multiple LogFiles in CMTrace. Default value is 1500|
|-ActiveLogProgram||Specify which Log Program should be active when the tool is starting. Default value is ‘CMTrace’|
|-DisableHistoryLogFiles||If specified, the Tool won’t open any history log files|
|-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.|
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' -WindowStyle 'Maximized'
Using the Tool
Using the Tool is pretty straight forward. First, download the Tool from the Link above and launch it in PowerShell as below:
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-18 open log files in CMTrace and Actions 50-54 will open file explorer to manually view some log related folders. Use Action 95 to toggle between CMTrace and CMLogViewer.
Using Action 93, you can view and open single LogFiles based on their Modify Date.
Using Action 96, you can execute some Client Actions on the connected Device, like updating the Machine Policy for example.
Using Action X, you can view the Tool Options. Here you can install /update or remove the ConfigMgr Console Extension. You can also install / update the PendingReboot PowerShell Module, which is used to display the Reboot State in the top of the menu.
Please note, that the current Path of the Tools PowerShell File will be used in the Console Extension. If you move the PowerShell file, you need to update the Console Installation by re-executing Action 1.
Below, you can see 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. 🙂