Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to query an LDAP user record in Script

Simon T
Kilo Contributor

Hello

We have an LDAP integration for user authentication and single sign-on login.

I would like to query the other LDAP user attributes that we import in a server side script using   ( gs.getUserName() as the query param) .

Can someone tell me how this can be done if possible in script?

I was think something along the line of:

var ldap = new GlideLDAPUsers();


ldap.load( gs.getUserName() );

...

But got no further...

 

1 ACCEPTED SOLUTION

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi Simon,

have a look at this documentation, it will help to find the other user attributes to be used in your script:

LDAP transform maps

Hope this will be useful for you.

Please, remember to mark Correct or Helpful if you find my response useful.

Cheers
Alberto

View solution in original post

6 REPLIES 6

Sure, now done.

In "GlideRecord('ldap_import')", is 'ldap_import' a ServiceNow Glide function or something else like a data source or transform map?

We need our LDAP import transform maps to directly query LDAP to find records related to but different from the LDAP transformed. Your "GlideRecord('ldap_import')" suggestion, as well as possibly GlideLDAPUsers, might be our solution.

Thanks