Active Directory and Ldap Integration via Mid Server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 01:35 PM
Hello I've been recently working on converting our AD/LDAP connections from being direct from ServiceNow to our company network via VPN tunnel TO using mid server.
ServiceNow makes this very easy to configure LDAP Servers for data sources run through Mid Server; however, this breaks our current solution for dynamic lookups/checks against AD/LDAP. (Example. User enters an AD group name on a request form, A lookup is done to find out if the group is restricted and prevent user from proceeding).
Our Current Solution for realtime lookups uses the GlideLdap() object in a script include as seen here:
https://www.servicenow.com/community/developer-forum/reading-ldap-in-a-script/m-p/1609469
Example Code:
- Transaction times were 7+ seconds which was too slow for form submission validations
- Only Active Directory connections would work. Our LDAP/Dirpoxy connections were not supported.
As a last ditch workaround I have developed a script include that will:
- Create an ECC queue record with high priority to mid server
- Payload for this record is a custom midserver powershell script exec command to query AD and LDAP
- Powershell Mid Server Script is called and uses the Directory Services module to establish connections to AD and LDAP
- Script include waits for the response ECC queue record to populate and grabs the response data from AD/LDAP lookup
- Data is further processed and passed back to calling client scripts for form validation.
This solution takes around 3 sec to complete which is faster than flow and acceptable enough for form processing (with ui help).
I was curious on if anyone else has run into this rather unique problem and if there was a better/faster solution for both AD and LDAP/dirproxy lookups on demand using script include?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2025 07:03 AM
I do have a same problem statement.May I Know,
How you Implement this solution using powershell script?
how you do the validation in the form?