Share via


ConfigMgr (SCCM) – SLP-MP Health Check Script

I would like to share a very useful script to check the availability/functionality of Management Point (MP) and Server Locator Point (SLP) in a ConfigMgr environment.

Download the script from HERE

Usage

SLP-MP Health Check Script can be scheduled to run automatically with no user intervention. To run the SLP-MP Health Check Script, download the script with all supporting folder s to the local drive. Set up a Windows scheduled task to run SLP-MP Health Check Script at the preferred interval.

How it works?

SLP-MP Health Check Script will connect to SCCM/ConfigMgr DB and run a SQL query to fetch the list of servers with MP & SLP roles installed. The query will return SiteCode, ServerName & RoleName details. These details are furnished in a tabular format (with the test results of MP/S & SLP/S) and send across an eMail alert to receipts.

Sample eMail alert :

http://anoopmannur.files.wordpress.com/2012/01/image_thumb1.png?w=317&h=138

MP & SLP checks in Detail

The server details are stored in an array. Each entry of this array is called using FOR loop and Individual checks are carried out in the below fashion.

1. The MP check function is called to run the below checks for each server with MP role installed.

MPListURL = "http://" & StrMPServer & "/SMS_MP/.sms_aut?mplist"

MPCertURL = "http://" & StrMPServer & "/SMS_MP/.sms_aut?mpcert"

MPPolicyURL = "http://" & StrMPServer & "/SMS_MP/.sms_pol?" & SoftwarePolicyID

Note! – Change the constant value of SoftwarePolicyID = "C0100000-C0100000-2D40483D.1_00" used in the script. Use PolicySpy tool to find out any of the existing policy ID (SoftwarePolicyID) in your environment and use the same for the MPPolicy checks.

The separate advertisement can be created to conduct MPPolicy checks. You can use PolicySpy tool to find out Policy ID details of new advertisement.

2. The SLP check function is called for checking the SLP details for required servers. More details on SLP checks – See, LINK

SlpURL = "http://" & SMSStrServerName & "/sms_slp/slp.dll?site&ad=<ADSITE Name>"

These results will be stored in a different array and will be used at the time of creating output file.

Error Handling

The script always sends an email every time it runs, even if there are no errors in the MP and SLP list, so the absence of an email serves as a warning that the tool may have failed completely. There are some instances where this could happen – if the server the tool is scheduled to run on is down or if there is an issue with the SQL server or if there is an issue with the SMTP mail server. In these cases further investigation and intervention will be required.

In all other cases the tool will send an email detailing the success and failures for that cycle. The log files stored in “ActivityLog” folder is very helpful in troubleshooting the issues.

Sample email 1 :

http://anoopmannur.files.wordpress.com/2012/01/clip_image003_thumb1.jpg?w=307&h=78

Sample Mail 2 :

http://anoopmannur.files.wordpress.com/2012/01/clip_image004_thumb1.png?w=308&h=158

Sample Mail 3 :

http://anoopmannur.files.wordpress.com/2012/01/clip_image006_thumb1.jpg?w=310&h=41

GREEN The results of the checks are Successful.

YELLOW At least One check needs to be Successful.

RED All the three checks failed.

The activity checks logs will be created on the “ActivityLog” folder.

Sample Log :

http://anoopmannur.files.wordpress.com/2012/01/clip_image007_thumb1.png?w=322&h=246

Prerequisites

- The Account should have access to SQL DB.

- Need to create two blank folders “SummaryHTM” and “ActivityLog”. These folders are used to store the log and HTM files. (You can download the zip file and extract it. This will automatically create the required folders)

- FIVE changes you need to make before running the script.

1. Replace "DATABASE-SERVER-NAME" with DB server name / instance. e.g StrSMSDBServer = "DATABASE-SERVER-NAME"

2. Replace "SMS_SiteCode" with DataBase name. e.g StrSiteDB = "SMS_SiteCode"

3. Change the constant value SoftwarePolicyID = "C0100000-C0100000-2D40483D.1_00" used in the script and use PolicySpy tool to find out any of the existing policy ID (SoftwarePolicyID) in your environment and use the same for policy test. Or Create new Package, Program, Advertisement and Collection to create a new PolicyID dedicated for this script.

4. Change SLP check URL to reflect your AD Site if you’re using AD site as SCCM/ConfigMgr boundary.

5. Change the Email configuration details – “SMTP Server Name”, “FROM” and “TO” MailIDs

Note! – The Alert Mail may be there in “Junk E-mail”. Just click “Not Junk” to get that in your INBOX!

http://anoopmannur.files.wordpress.com/2012/01/clip_image008_thumb1.png?w=310&h=104

Note – This post is provided “AS IS” with no warranties, confers no rights, and is not supported by the author. I’m not sure about the origin of this script .