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 ...
                    • How to install SSL certificate in AssetExplorer

                      SSL Installation Do you have a Wildcard or a Multi-domain certificate already running in your other servers and want to reinstall in on AssetExplorer server ?, then click here to find how to export SSL certificate using MMC.  Do you already have a ...
                    • 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 ...