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.

Documentation for GlideLDAPUsers()?

perkinsarm
Mega Guru

There is an OOB UI Action Refresh from LDAP that runs this script:

var ldap = new GlideLDAPUsers();
ldap.load(current.user_name.toString());
action.setRedirectURL(current);
gs.addInfoMessage(gs.getMessage("Reload of LDAP data for {0} has been started",current.name));

I am trying to determine what ldap.load returns or what other methods might be available? I haven't been able to find any GlideLDAPUsers documentation.

I want to run a script that loops over all of our active users and flag any that are no longer in the external LDAP user directory.

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@perkinsarm 

As an admin/developer we may not be able to access it just like the class GlideRecord

It is at platform level.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks,

I figured it was internal, but was hoping that like GlideRecord, documentation are available. I've figured out that it returns an object, that likely contains ldap directory elements. I was hoping to easily catch when an active sys_user record that was created via ldap in the past was no longer in LDAP.

I ended up not using GlideLDAPUsers().

Instead, I wrote a fix script that compared all active 'ldap' sys_user records against the contents of the latest LDAP import table updates. Users not in the latest LDAP import have been flagged for deactivation.

@perkinsarm 

Thanks for sharing the update.

Let me know if I have answered your original question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Can you share your fix script for comparing all active 'ldap' sys_user records against the contents of the latest LDAP import table?