SCCM Server Infrastructure Monitoring Script without SCOM OpsMgr Automation ConfigMgr

Let’s SCCM Server Infrastructure monitoring script without SCOM. We have a post about SCOM monitoring of SCCM infrastructure. Hopefully, this automation script from Karthikeyan can help ConfigMgr admins to automate some of the monitoring tasks.

“Have you ever wished you could peer inside the mind of one of the greatest SCCM bloggers in the world and find out exactly what makes them tick?” Yeah! Right 😊😊. Updated the script on 29th July 2021.

So in this blog, we will be talking about various SCCM components troubleshooting methods already used and documented by our experts to make our day 2-day operations a lot easier. You all have done the unthinkable.

SCCM Server Infrastructure Monitoring Script without SCOM

Now you will be thinking that you have already spent plenty of time reading those articles/blogs, so why should you waste more time on the same things again but Hey, Hear me out, We will not be discussing those error codes, resolutions, root cause, and workarounds once again.

Patch My PC

Still, we will try to pick a few of them and find a method to automate them by any means necessary. So, let’s find out more details below about SCCM Server Infrastructure Monitoring without SCOM OpsMgr.

Note:- Brain behind this scrip is Author:- A, Karthikeyan

So without any further delay, let’s see what we got in our hands.

Note:- These instructions are intended for ConfigMgr Team in the normal execution of infrastructure management.

Core Infrastructure Check – All in one.

The main reason to pick the “All in one” check at the very beginning, because we all try to complete this check before entering the change request freeze window, and at that moment, all we can think of is we should not leave any stone untouched.

So this script is essential for all those SCCM Administrators who always think that what if I missed any component and it’s going to create chaos. Don’t worry. Be happy.

Copy the script from the bottom of this post and execute it either on your CAS or Primary site, whichever you have the highest in your hierarchy. The script generates the output into an HTML format and with the status in different colors, making it easy to spot. Once execution completes, the output will look like below:

SCCM Server Infrastructure Monitoring without SCOM OpsMgr Automation ConfigMgr
SCCM Server Infrastructure Monitoring without SCOM OpsMgr Automation ConfigMgr

The output will be saved to the same directory where you have saved this script at the execution time. Now you can see in the above screenshot how detailed check it’s performing. There is no untouched part we need to worry about.

To verify if the script works or not, we purposefully broke the backup and executed it. The script highlighted that the backup failed. Screenshot below:

SCCM Server Infrastructure Monitoring without SCOM OpsMgr Automation ConfigMgr
SCCM Server Infrastructure Monitoring Script without SCOM OpsMgr Automation ConfigMgr 5

Status in red and with the type if it’s Site Backup or DB backup which got failed. Hold on. We are not done yet. You can schedule a task to execute it and forget about it. There is more. You don’t have to jump to your server every time to check the status. It’s capable of sending the HTML file to your e-mail so you can read the current status.

Below are few points which we need to keep in mind before setting up our SCCM Infrastructure.

ConfigMgr Administration Best Practices

Let’s check the list of administration best practices. Hope you have got all the information on SCCM server Infrastructure Monitoring without SCOM OpsMgr.

  1. Use AD Sites to define ConfigMgr boundaries to avoid overlapping.
  2. Automate maintenance tasks and create custom maintenance tasks.
  3. Create OUs for ConfigMgr Servers.
  4. Use AD Groups and Accounts for managing the ConfigMgr environment.
  5. Keep administrative rights to a minimum level of Access.
  6. Create a plan for role-based administration and apply only the rights necessary to perform job function.
  7. Use NTFS on all client and server partitions.
  8. Assign the least permissions possible.
  9. Do not install site servers on Domain Controllers.
  10. Do not install other services that use the local system account.
  11. Use GPO and ConfigMgr Client Push Method to install client agent on computers.
  12. Add only required users to ConfigMgr admins group, or created alternate groups and use role-based access control for permissions.
  13. Create ConfigMgr AD OU containers for service IDs, Application Management ID’s, Management groups and Servers.
  14. Lock down the ConfigMgr Infrastructure using Domain Groups and Accounts.
  15. Configure SUP on every primary and secondary site server.
  16. Enable SMTP access on Top ConfigMgr server to send a custom SSRS Reports.
  17. Only deploy the ConfigMgr client to computers that are trusted.
  18. Do not use a domain admin account as the client push installation account.
  19. SQL Server must be configured to use Windows Authentication.
  20. Remove or Disable the Guest account from the ConfigMgr SQL Database.

Disclaimer – The information provided on site is for general informational purposes only. All information on the site is provided in good faith. However, we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the website.

Script

Let’s find the script below produced by Karthikeyan. Please go through the script and make the necessary changes before trying it out. Update 28th July 2021 – How to use the script.

  1. Copy the Script and execute. (If any errors at the initial level of execution then let me know)
  2. It will create a default config file for you at the same path where you have saved this actual script.
  3. Modify the config.xml to match to your server names etc. Look for SCCMCentralDBName, SCCMCentralDBServerName.
  4. More details in the comments below.

Note:-As soon as you execute the script it will ask to create a default configuration file to the same location where you have saved this script. Screenshot below:

SCCM Server Infrastructure Monitoring Script without SCOM OpsMgr Automation ConfigMgr 1
SCCM Server Infrastructure Monitoring Script without SCOM OpsMgr Automation ConfigMgr 6

Now you have a ConfigXML file. Open the ConfigXML file with Notepad and please modify the values according to your infrastructure. A script required Admin rights on all SCCM Servers and read access required on the database to fetch the component error details. Screenshot below:

SCCM Server Infrastructure Monitoring Script without SCOM OpsMgr Automation ConfigMgr 2
SCCM Server Infrastructure Monitoring Script without SCOM OpsMgr Automation ConfigMgr 7

Download the Script from GitHub https://github.com/AnoopCNair/ConfigMgr-Infra-Monitoring

Resources

Monitor the hierarchy

ConfigMgr MP Health Check Script | SCCM Endpoint Manager

26 thoughts on “SCCM Server Infrastructure Monitoring Script without SCOM OpsMgr Automation ConfigMgr”

  1. It looks like there is a little bit of trouble between lines 228 and 238. We have 2 close brackets and no open brackets causing problems.

    Reply
    • Hi,

      Script is not fully posted in website. I have requested admin to post the script in public GitHub repository.

      Thanks
      Karthikeyan

      Reply
  2. Is there more to this script? Where does the script actually do the checking? I looked this over and it seems like it is just saving a config file and setting lots of variables.

    Reply
    • Agreed – What lines in the script actually check the services? I only see a bunch of variables being assigned. Definitely seems like the code block is missing the part of the script that actually does the health check

      Reply
    • Thank you for highlighting Jam Max. Please refresh the page. I just updated the blog with few more steps and it should work for you. Let us know the result post testing.

      Reply
      • Hi Deepak

        I dont know why I am not getting output… I have followed after you have updated blog.
        1. copied and run script
        2. ConfigFile.XML created and made changes as per environment
        3. Then I run the script again but no output except below.
        *******************************************************************************
        File Name : ConfigMgr_Daily_Servers_Health_Check_Reports
        Purpose : ConfigMgr_Daily_Servers_Health_Check_Reports to sent an email
        Version : 01.00
        Date : 27/01/2021
        Author : Project Test | [email protected]
        *******************************************************************************
        I didnt find any output file at ConfigMgr_Daily_Servers_Health_Check_Reports or any sub folder

        Did I miss anything or am I doing something wrong. Please guide what next I have to do

        Thanks in advance: A new Learner in PS

  3. Might be preferable to remain here, since we’re responding to Anoop’s post. Having the information spread across various sites is unhelpful.

    As per Josh’s comment above, is there some content missing from the script? I can’t see it doing anything like examining components etc. Just variables and basic output.

    Reply
  4. Agree with other commentors on this post, the script appears to be missing any functions to actually output the results file.

    Reply
  5. Hello Team,

    When i run the report it always shows that almost all servers are having the DNS issues. But when we manually check the DNS on the servers everything is fine and the resolution happens properly. Not quite sure what else is the issue.
    Could you please help me in fixing the issue.

    Thank you

    Reply
    • We might have to dig deeper because the script performs a very basic level of check like A Records etc. One should try checking the FQDN and NETBIOS Name are same. IPCONFIG /FLUSHDNS can be tried and see if the issue goes away. For more prompt response and ideas please use our forum “http://forum.howtomanagedevices.com/” where you will get a lot more directions to find the root cause of your issue.

      Reply
  6. Hi, would be nice to understand, if there is some documentation included to tell what it really does, how to configure and so on.
    ie. I don’t understand what to Server1,Server2 means. All servers in organization? All SCCM realted servers, ….?
    But still, thanks!

    Reply

Leave a Comment

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