SCCM Automate ConfigMgr Health Check Reports

Automate ConfigMgr Health Check Reports

Introduction

This section describes the purpose and audience of this guide. Any terminology or acronyms used in this document will be referenced in the Glossary of the Appendix section.

Purpose

The intent of this ConfigMgr Health Check Reports helps an SCCM administrator to ensure that the SCCM server are highly available and are performing at optimum levels.

Scope

This technical instruction applies to the SCCM Delivery Team. This work instruction does not cover tasks which are the responsibility of any other team.

Disclaimer

1. No License.

2. Script is created using Windows PowerShell (Integrated in Windows Operating System).

Overview

Script will perform the SCCM Server Health Check report as per the task scheduler. Any issues then script will trigger an email alert.

Benefits

1. We can avoid manual human efforts to capture SCCM Health Check reports and time reduction.

Prerequisite

1. Separate service account or System Account is needed to execute this ConfigMgr Health Check Script.

2. SMTP access required only for Email notification alert (Optional).

How does it works

Windows PowerShell script checks the SCCM Server Health status on SCCM server. Finally script will generate an HTML file along with identified issues then send an email notification alert to receipts email groups.

Important note

1. Test this script on test environment before implementing to production environment. You will get an idea how that script is working.

2. While executing this script, script will always generate a log file with same file name in same folder path.

3. If script is not working as expected, Log file will tell you why the script is not executed properly.

How to configure this script on server

/ Download the script.
/ Create a new folder as Scripts from your server on D Drive (If folder already exists then ignore).
*** Recommended to use D or E Drive only based on your Environment available Drive ***
/ Create a new folder name as ConfigMgr_Health_Check_Reports inside the Scripts folder.
/ Place the ConfigMgr_Health_Check_Reports.Ps1 inside the folder.
/ Edit the PowerShell script with à Notepad.
/ Modify the values as per your project
requirements and save the file.
/ Ensure the script is modified properly, finally execute the script and check the log file to know the status.
/ Script is not working as expected, Check the Log file.

Memory utilization

Script is designed in such a way to check the server health sequence one by one (not in parallel). So script will not take more memory utilization in server to complete the job.

Before script Execution Process Memory Utilization
While script Executing Process Memory Utilization

Rollback plan

1. Stop and remove the script from the server scripts folder.

2. If any task scheduler is created for this script to execute on daily basis then remove the script from task scheduler.

How to configure this script in task scheduler to execute automatically on daily morning at 7:00 AM

/ Open Task Scheduler from Start Window.
/ In the Task Scheduler Window, Select Task Scheduler Library folder,
Right Click à Create Task à Select.
/ In the Create Task Window
Nameà ConfigMgr_Health_Check_Reports.
Configure Separate Service account with proper privilege access or System Context account to execute the script.
Select Run whether user is logged on or not Option.
Select à Run with Highest privileges check à Hidden Option.
/ In the Triggers Tab à Select New Button.
/ In the New Trigger Window.
1) Select Daily Settings, Start time 07:00:00 and Recur every 1 days.
2) In the Advanced Settings, Select the Check box as stop task if it runs longer than: 1 Hour.
3) Tick the Enabled Check box.
4) Finally Click OK.
/ In the Action Tab à Select New Button.
/ In the New Action Window.
1) Action à Start a Program.
2) Settings à Select the ConfigMgr Health Check Reports.Ps1 file.
3) Click OK.
/ In the Settings window.
1) Tick the Check box Allow task to be run on demand.
2) Tick the Check box Stop the task if it runs longer than: 1 hour.
3) Tick the Check box if the running task does not end when requested, force it stop.
4) Click OK.
/ Enter the Password and click OK.
/ Ensure the script is configured successfully.

7

Prepared By : N. Ramu Rao

Document Version No : 1.00