SCCM Client Health Monitor Script


The SCCM Client Health Monitor Script is a Powershell script which fixes common issues related to SCCM client health.

The script is currently capable of fixing following issues:

  • SCCM client stuck in Provisioning Mode
  • Corrupt Group Policy files (Registry.pol)
  • BITS transfers with errors
  • SCCM client service not running
    • SCCM client service disabled
  • No SCCM client installed

Further to fixing the mentioned issues, the script also supports sending an e-mail or a status to Microsoft Teams if any issues are found. All actions are logged to a local log file: SCCM-ClientHealthMonitor.log in the CCM\Logs folder.


.\SCCM-ClientHealthMonitor.ps1 -TestProvMode -TestGPOFiles

This will run tests and try to fix issues related to provisioning mode and corrupt group policy files.

.\SCCM-ClientHealthMonitor.ps1 -TestSCCMClient -InstallSCCMClient

This will test for a running ccmexec service and try to start the service if it’s not running. If the service doesn’t exists, the script will try to install the SCCM client.

.\SCCM-ClientHealthMonitor.ps1 -TestProvMode -TestGPOFiles -TestBITS -TestSCCMClient -InstallSCCMClient -EmailStatus -TeamsStatus

This will run the script with all available options.


The e-mail being sent with the -EmailStatus parameter looks like below example.

Microsoft Teams

The status messages being sent with the -TeamsStatus parameter will look like below examples.


The SCCM-ClientHealthMonitor.log file will look like below example when opened with CMtrace.


  • The script requires local administrative rights to run
  • Modify the script. I have made a comment with # EDIT here the places that needs editing
    • Modify the -EmailStatus part with your own details such as SMTP server, recipient etc.
    • Modify the -TeamsStatus part with your own details such as URL for webhook, title, text etc.
    • Modify the Install-SCCMClient function with MP and site code details

Running the Script

The best option to run the script, is to do so with a scheduled task.

  • Running as SYSTEM
  • Trigger: Running at log on of any user
  • Action: Starting powershell.exe with argument: -ExecutionPolicy Bypass -File “\\ServerShare\SCCM-ClientHealthMonitor.ps1” -TestProvMode -TestGPOFiles -TestBITS -TestSCCMClient -InstallSCCMClient -EmailStatus -TeamsStatus

Version history

  • 1.0 – Script created
  • 2.0 – Added TestBITS, TestSCCMClient and InstallSCCMClient
  • 3.0 – Added TeamsStatus, making the script able to send status notifications to Microsoft Teams
  • 3.1 – Minor changes to $ComputerModel as well as added more commenting


Need Help?

I haven’t done the best commenting job in the script itself, so please let me know in the comment section down below if you need any assistance. 🙂

And of course, it goes without saying, but test this thoroughly before putting to use in production.

Also, if you are looking for more details on how to prepare Microsoft Teams for receiving notifications, please take a look at this great post by Michael Mardahl:

11 thoughts on “SCCM Client Health Monitor Script”

  1. I’m kind of new to Power shell. When I pick part of it to test it say it wont load it because its not digitally signed. Is there a way around that?

  2. hi,

    thanks for the awesome script!

    we keep receiving “BITS transfer errors found. Remediation succeeded. Log is attached.” every single day for most of the time the same devices… are we missing something?

    • Do you have google chrome installed? I’m seeing that with google chrome updates. What I do is simply querying for bitstranfers job with get-bitstransfer -Allusers, and if any found, I report an error. This is not necessarily related to configmgr, but it can be an obstacle if a download job coming from configmgr is in error.

      • thanks. some may have a portable chrome but thats it and updates should be disabled. i will try to give a look a a few random devices and try to find out whats going on… maybe the script could add the bits result to the log file?


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.