Update user data from AD

david_hreben
Giga Expert

Hello,

I was wondering if there is a way to update a user record in ServiceNow right after a change have taken place in Active Directory? I was wondering if it can be done in a script so that it can be executed though Java Console or any other way.

 

One thing I have noticed also, the related link "Refresh from LDAP" on the user record does not seem to update anything.

 

There might be a way to do it with the link listed below but I just want to make sure if it can be achieved in any other way;

URL:Orchestration Example - Active Directory User Management - ServiceNow Wiki

 

 

Thanks,

14 REPLIES 14

Thanks John, that is very interesting. I will try to stop and re-start the listener and see the results.


SeanM1
Tera Guru

Refresh from LDAP .png


In our instance we created a related link with the following UI:



Table: sys_user


Condition: !current.source.isNil() && gs.hasRole('admin')


Script:


var ldap = new GlideLDAPUsers();


ldap.load(current.user_name.toString());


action.setRedirectURL(current);


gs.addInfoMessage("Reload of LDAP data for " + current.name + " has been started");


Sean,



I have the same set up in my system, LDAP listener seems like is configured correctly but this UI Action does not seem to work in my system. We have AD account from different domains, not sure if it affects the Refresh from LDAP functionality.


Hi David,



Do you have the following line somewhere within your LDAP import map:



// Set the source LDAP server into the target record


target.ldap_server = source.sys_import_set.data_source.ldap_target.server;



There's an ldap_server field on every user's record and it helps if this is populated with the appropriate LDAP server that the user is associated to.


Yes, I do actually. I found out that something new about my records that are not updating on Servicenow. Apparently the distinguished name in AD looks different to the one in AskNow. Seems like something happened when the user record in AD moved to another domain.I am not sure why ServiceNow is not updating this info even though is configured to do so...



Thanks Brad!