Enhancing Troubleshooting with Verbose Logging in SCCM

Verbose logging is a powerful tool that provides a detailed record of events, actions, and errors, making it invaluable for troubleshooting, diagnosing issues, and monitoring activities.

When enabled, verbose logging offers an enhanced view of what's happening within client, offering deeper insights that can prove essential for IT administrators and support person.

By default, SCCM keeps verbose logging disabled. This conservative approach is to prevent generating extensive log files, However, when tackling complex problems or investigating unusual behavior, verbose logging becomes an essential ally.

Here, we'll explore how to enable and disable verbose logging at the client level in SCCM using PowerShell commands. These commands allow you to quickly switch between standard and verbose logging as needed.

Enable-Verbose.ps1

Set-ItemProperty -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL -name LogLevel -value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL -name LogMaxSize -value 15500000 -ErrorAction SilentlyContinue
Set-ItemProperty -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL -name LogMaxHistory -value 5 -ErrorAction SilentlyContinue
New-Item -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging -Name DebugLogging -Force -ErrorAction SilentlyContinue
Set-ItemProperty -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging\DebugLogging -Name Enabled -value True -ErrorAction SilentlyContinue
Restart-Service ccmexec

Disable-Verbose.ps1

Set-ItemProperty -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL -name LogLevel -value 1 -ErrorAction SilentlyContinue
Set-ItemProperty -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL -name LogMaxSize -value 250000 -ErrorAction SilentlyContinue
Set-ItemProperty -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging\@GLOBAL -name LogMaxHistory -value 2 -ErrorAction SilentlyContinue
New-Item -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging -Name DebugLogging -Force -ErrorAction SilentlyContinue
Set-ItemProperty -Path Registry::HKLM\SOFTWARE\Microsoft\CCM\Logging\DebugLogging -Name Enabled -value False -ErrorAction SilentlyContinue
Restart-Service ccmexec

 

These PowerShell scripts allow you to enable or disable verbose logging quickly. They set various parameters within the Windows Registry that control SCCM's logging behavior. Remember to restart the "ccmexec" service to apply the changes.

There are alternative methods for enabling or disabling verbose logging such as using the SCCM console at the client level.

image

Depending on your specific needs and preferences, you can choose the method that best suits your requirements.

Leave a Reply