SCCM Health Check PowerShell Script Updated to Version 3.3

I have updated the SCCM Health Check Script again. The latest version is now 3.3.

Below is what’s been updated since my last post for version 3.1:

  1. Fixed the bug where when using DOTNET sending emails to multiple recipients, it only sends to the first recipient from the list.
  2. It now zip the txt attachment to zip file before sending it. this is to improve the performance and avoid sending large attachments.
  3. Added functionality to check all current active package distribution
  4. Able to create exemptions for DNS suffix check. This can be configured in the XML. (this is required at work as there a HOST record is created for central site server in another forest because there’s no forwarders setup between 2 forests.)
  5. Improved DNS checks
  6. Fixed the bug when SQL DB is not running under default instance. The script now reads SQL DB location from primary site server’s registry.

The script package now contains an additional file ICSharpCode.SharpZipLib.dll This is an open source project from This file is used to zip txt attachment.

The script now contains the following files:


I’ve also been told the DNS check does not work well when SQL DB is on a cluster. I don’t have access to a SQL cluster where I can diagnose the problem. So please just be aware.

The script can be downloaded here. Please remember to customise the “Health-Check.XML” file before running it.


  1. Do you have any examples to show the output of this script? Any prereqs? Do you run from the central site? Thanks for your help!

    1. Hi Glenn,

      You can see a script print of the output email from the original post. you don’t have to run it on the central site server. but better to run it on a machine that is local to the central site server – for better performance. In terms of pre-reqs, other than what’s already documented in the original post, the account you run the script will also need to have local admin rights to all site systems- this is required as part of the DNS check (the script connects to each site system’s WMI to check the computer name).

  2. Hi Tao,

    The SCCM Health Check Script is a really a great tool and saves me a lot time having to find issues in my environment. I started running this tool on my tools machine against the central site and ran into issues. It seems to run 2 – 3 times without any issues but later I realiased that the script is actually killing the RPC server service on the Central Site and the server restarted for this reason.

    Do you know why this is happening?



    1. Hi Rajiv, I’ve been running this in the production environment for over 6 month and did not run into any issues like what you’ve mentioned. it certainly uses RPC to connect to central site server and site provider for some checks, but it should not cause the RPC server to restart or crash. did you find anything in the system event log that are related to the restart of RPC service?

  3. Hi Tao,

    Thanks for your reply. This is the event which was logged after the server came back up.

    Log Name: System
    Source: USER32
    Date: 8/8/2011 1:15:59 AM
    Event ID: 1074
    Task Category: None
    Level: Information
    Keywords: Classic
    User: SYSTEM
    Computer: XXXXXX
    The process C:\WINDOWS\system32\services.exe (XXXXX) has initiated the restart of computer XXXXXXX on behalf of user NT AUTHORITY\SYSTEM for the following reason: No title for this reason could be found
    Reason Code: 0x30006
    Shutdown Type: restart
    Comment: Windows must now restart because the Remote Procedure Call (RPC) service terminated unexpectedly
    Event Xml:



    C:\WINDOWS\system32\services.exe (XXXXXXX)
    No title for this reason could be found
    Windows must now restart because the Remote Procedure Call (RPC) service terminated unexpectedly

    After googling for this error I found there is a hotfix and have applied the same to my Central Site. Hopefully that would fix the issue.

    Here is the hotfix information:;en-US;2401588

    Thanks & Regards,

  4. Tao,

    I have one more issue… The script is not able to pull the Inboxes backlog even when I set the Threshold as low as 5. After looking at the report it gives me a error – “not accessible. please check!” What should I check? The user under which the script is running has FULL ACCESS to SCCM.

    Appreciate your suggestions in this regards. Thanks, Rajiv!

    BTW the hotfix seems to have fixed my RPC issue.

    1. Hi Rajiv, Are you using diruse.exe or using PS Remoting to check inboxes? If you set to use PS Remoting in the XML, did you enable WinRM on all site servers? Are you running it via Task Scheduler when you running into this issue? What happens if you change $ErrorActionPreference=”Continue” at the very top of the script and run it manually under your admin account? what error message did you get on the powershell console?

      1. Toa, I am using PS Remoting and have enabled WinRM on a couple of sites to see if it works but then it gives the same error for those sites too. I am currently running the script manually. I will try to change $ErrorActionPreference=”Continue” and see if that makes a difference. I dont see any error message on the powershell console as well. It just says that it is trying to check the Inboxes on the powershell console.

  5. Here is the error that I see on the PS console.

    My SCCM installation is on the G drive and looks like it does not like that.

    Join-Path : Cannot find drive. A drive with the name ‘G’ does not exist.
    At C:\PsTools\SCCMHC\SCCM-HealthCheck.ps1:1284 char:30
    + $SCCMInboxesDir = Join-path <<<< ((Get-WmiObject Win32_share -ComputerName $site.ServerName | Where-Object {$_.Path -eq $site.InstallDir}).path) "inboxes"
    + CategoryInfo : ObjectNotFound: (G:String) [Join-Path], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand

    * inboxes location: on XXXXXXXX
    Cannot bind argument to parameter 'Path' because it is null.
    + CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand

        1. Rajiv, can you send me an email so I know your email address and I’ll email you few lines of code for you to run and troubleshoot? my email address is on the Contact page of this blog.

  6. Hi,

    The script is working for me when run manually, however when set to run as a scheduled task the script doesn’t report information for the server in the primary site server section of the XML.


    It does however pick up the database server and extra site Servers no specified in the XML.

    Any ideas on this?

    1. The script locates the SMS provider server from site server’s WMI repository (the site server you specify in XML). then get a list of site systems from SMS provider via WMI. so if it gets other site systems and SQL servers, the primary site server you specified in XML should be valid.
      When you run it via scheduler, does the user account that runs under have sufficient rights in SCCM, SQL and Windows OS?

  7. On the report, there is a section called “Site Systems with issues.” It list the roles of the servers with issues, but it does not list the site server name. How do I add the server name?

    The SMS Component Server and the SMS Distribution Point Directories, which directories are you looking at (SMSPKG maybe) and how do you determine Percentage Free?

    Example of report listed below.

    Site Systems with issues

    SiteCode Role ObjectType PercentFree Status
    ——– —- ———- ———– ——
    ATC SMS Component Server Directory -1 Critical
    ATC SMS Component Server Directory -1 Critical
    ATC SMS Distribution Point Directory 83 Warning
    ATC SMS Distribution Point Directory 53 Warning
    ATC SMS Distribution Point Directory 87 Warning
    ATC SMS Distribution Point Directory 96 Warning
    ATC SMS Distribution Point Directory 86 Warning
    ATC SMS Distribution Point Directory 52 Warning
    ATC SMS Distribution Point Directory 90 Warning
    ATC SMS Distribution Point Directory 98 Warning

    1. Hi Michael,

      Thanks for pointing it out. I should be able to add the site system name to it. I’ll do it in the next couple of days and post a new version with couple of other updates.


      1. Hi Tao,

        Would it be possible to include a feature that allow to run script only on a certain number of sites (i.e Primary servers only, or secondary servers only) ?

        It would also be great if we can filter out the BDP from DP status ?

        YOur tool is great anyway!!!


        1. Cedric,
          The script connects to the primary site you specify in the XML and then go through any child primary/secondary sites. In XML, you can also specify which sites you wish to exclude.

  8. I configured the sending email option but it is not working with me !

    is there any tips ?

    Warm Regards

Leave a Reply to Rajiv Cancel reply

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

%d bloggers like this: