How to bulk Delete Requester based on domain

How to bulk Delete Requester based on domain

This is a sample python script that update bulk Delete Requester


It's highly recommended to take an application backup before performing the steps


A short guide on setting up python is available here.

Execution steps:

1. Download the attached zip
2. Move delete_user_schedule.py, configuration.json, functions.py, files to sdp_home/integration/custom_scripts folder
(Note Don't move configuration.json if the same file exists in that location)
3. Go to Reports --> New Query Report --> Copy the query to the query editor and run the report. 

Query to get the list of users based on the domain name

SELECT aaauser.user_id "userid",aaauser.first_name AS "name",AaaLogin.DOMAINNAME "domain" FROM  PortalUsers
LEFT JOIN SDUser sduser ON portalusers.USERID=sduser.USERID
left join aaauser on sduser.userid=aaauser.user_id
LEFT JOIN AaaUserContactInfo ON AaaUser.USER_ID=AaaUserContactInfo.USER_ID
LEFT JOIN AaaContactInfo ON AaaUserContactInfo.CONTACTINFO_ID=AaaContactInfo.CONTACTINFO_ID
LEFT JOIN AaaLogin ON AaaUser.USER_ID=AaaLogin.USER_ID
where sduser.status='ACTIVE' and portalusers.userid not in (select userid from portaltechnicians) and
AaaLogin.DOMAINNAME = 'sdptest'

You can modify the domain name in the query. 
Check the output once and save the report

4. Now go to Admin --> Custom Schedules --> Create a new schedule as shown below





          • Related Articles

          • Top Requester based on Request

            This report is used to get the top 10 requesters count based on the request. To make any changes to a query, refer to the KB article below. https://pitstop.manageengine.com/support/manageengine/ShowHomePage.do#Solutions/dv/24000627781192 SELECT ...
          • How to populate requester details in request additional field

            Requirement: Populate requester additional field information into request additional field. Usecase: Let us consider a scenario where certain employee details are imported from the Active Directory into User - Additional Fields.  The business ...
          • Requester details

            This report is used to find the Requester complete details.  SELECT AaaUser.USER_ID, AaaUser.FIRST_NAME "FullName", AaaLogin.NAME "LoginName", AaaLogin.DOMAINNAME "Domain", AaaContactInfo.EMAILID "Email", DepartmentDefinition.DEPTNAME "Department", ...
          • How to auto share request to users specified in a request field (V3)

            Note: ServiceDesk Plus build should be  11.0 and above This post described the use of a python script to share requests to users specified in a request field. This script can be configured under Request custom triggers and you will find more ...
          • How to populate requester details in request additional field.

            This sample script is to populate the requester details in a request additional field.  Based on the requester name selected, we can fetch the user additional field informations using Field and Form Rules (FAFR) and populate the content in request ...