Freigeben über


CMTrace without CMTrace

A quick blog to give cheap pop to PowerShell and it's rescuing power, yet again. Just a nice, quick and dirty trick to emulate CMTrace when you are in an environment that may whitelist software from running on clients or they simply disallow tools from being copied to systems without change control.

For those not familiar with CMTrace, it is a tool that comes with Configuration Manager.  It is a text based viewer that scrolls text files in real time as they are written and has been a long time favorite since SMS, when it was called Trace32.  It is, by default, located in the installation folder of Configuration Manager\Tools.  So, C:\Program Files\Microsoft Configuration Manager\Tools.

So, say I want to look at the locationservices.log file and don't have CMTrace - well, PowerShell and the old school get-content cmdlet to the rescue. So, if I want to view that file in realtime like trace, I can use the tail parameter as such:

Get-Content -Path c:\windows\ccm\logs\locationservices.log -Tail 1 –Wait

...then restart the ccmexec (SMS Agent Host) service, or any other text based file (such as log) you know will be written to...  Go ahead, try this, I'll wait...

This will show the log content like notepad would render it, but at least you can monitor the file. Sorry about the lack of reds and yellows that CMTrace is so known for, but a nice "second best".

-- If you like my blogs, please share it on social media, rate it, and/or leave a comment. --