Some errors related to Python when trying to run a script in SDP MSP

Some errors related to Python when trying to run a script in SDP MSP

Case 1:

We could see cases where users come across the below error when trying to execute scripts. This happens if the requests library is not imported.  




In order to import the requests library in Python, follow the steps below:

1. Open cmd as admin and execute the below command. 

pip --version

If pip is already installed, you will see a message like the below about the pip version. 




2. Executing the below command in command prompt will show the python version. 

python -V




3. If you have pip as mentioned in step 1, go ahead and import the requests library in python. Execute the below command in cmd. 

python -m pip install requests

4. Once the requests library is imported, go ahead with executing the script. 


Case 2:

Some users try to run scripts on a test server and they might experience the below error. This happens if there isn't a proper certificate installed. 



In such cases, the ssl error can be ignored by mentioning the exception in the script file. 

Below is a sample script (add_notes_MSP.py) which adds note to requests to satisfy first response based on the criteria in the custom trigger. 




Adding the below exception in the script would exclude the ssl error and runs the script properly. 

import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

Updated script looks like below:




                    New to ADSelfService Plus?

                      • Related Articles

                      • Cannot run program "python" or Can't find a default python

                        Use case While trying to run a python script, this error can be found. It usually occurs when the python is not installed/set up properly. Solution Try specifying the complete path of the python.exe instead of py and then in the argument specify the ...
                      • How do I install SSL certificate for ServiceDeskPlus-MSP?

                        Introduction ServiceDesk Plus - MSP can run as a HTTPS service. But it requires a SSL (Secure Socket Layer) Certificate signed by a valid Certificate Authority (CA). By default, on a first-time start-up, it creates a self-signed certificate. This ...
                      • Python Troubleshooting steps

                        Here we are listing the troubleshooting steps for the python script to be executed 1. Check whether python is installed or not in the sever where SDP is installed 2. If it's installed check the version of python ( Preferable version should be above ...
                      • Python script to automate FCR

                        Please find the attached Python script on this link  to automate FCR via custom trigger when the request is created and resolved by the same technician. The link contains two Python scripts with the name FCR.py (this script can be used when MSP is ...
                      • How to install SSL certificate of .PFX format for 9.4 builds

                        Installing .PFX Certificate   .PFX is an extension for security certificate. It defines a file format that stores private keys (generated by your server at the time the CSR was generated) and public key certificate (your SSL Certificate provided by ...