ADMP Integration - Add/Remove users from Groups

ADMP Integration - Add/Remove users from Groups

Use Case:
Adding or removing a user from a group is a common but repetitive task that requires manual effort from the IT team. This process can be automated using the built-in capabilities of ServiceDesk Plus.

By leveraging the Dynamic Request Engine (DRE) in ServiceDesk Plus, we can trigger a Deluge script that adds or removes users from Active Directory (AD) groups through the ADManager Plus API.

Steps to set it up:

1.  Download the attached scripts.  

2. To connect ServiceDesk Plus with ADManager Plus, make sure you have the ADManager Plus URL, Auth Token, and Domain Name. These are required prerequisites.
Use a global function to store this configuration securely so it can be accessed by multiple custom functions.
   To create a global function:
   - Navigate to Admin > Request Custom Function > Global Functions > New
   - Set the return type to Map
   - Insert the contents of the file named ADMP_Configuration.txt
   - Save the function with a suitable name




3.  Go to Admin > Developer Space > Custom Function > Callback Functions and paste the contents of ADMPGroups_CallBackfunction.txt. Save it with an appropriate name.


4. Go to Admin > Incident Template / Service Catalog > Edit Required Template > Field and Form Rules > On Form Load.
   Create a new rule, paste the contents of PopulateLoginNamesIntoAdditionalField.txt, and save it with a descriptive name.
   In the rule configuration, select Execute Script and apply it to Technicians.


5: Go to Admin > Incident Template / Service Catalog > Edit Required Template > Field and Form Rules > On Form Load.
   Create another new rule, paste the contents of PopulateADMPGroups.txt, and save it with a suitable name.
   In the rule configuration, select Execute Script and apply it to Technicians.

6.  Update the callback URL and field names according to your environment in both scripts used in Steps 4 and 5.

7.  The actual functional logic for the automation should be defined under Admin > Request Custom Function > Custom Action.
   Update the LDAP field values and SDP additional field API field names in the script so the LDAPFields and SDPFields are mapped correctly.

8. With custom triggers, configure conditions such as “when a request is created” or “when a request is approved” to invoke the Deluge script stored in the custom function. This allows the system to automatically add or remove the user from the relevant AD group.

For Adding to a Group:





For Removing from a Group:



Summary:
This automation eliminates the need for manual group management, reduces operational effort, and ensures that user group membership in AD is updated consistently based on ServiceDesk Plus request actions.