LDAP Manager Field

carlosrlara
Mega Expert

I presently have the LDAP looking for the following attributes

sn,name,telephonenumber,samaccountname,source,mobile,mail,physicaldeliveryofficename,givenname,useraccountcontrol,manager

When i tested an import the manager field comes in as such

i have edited below

CN=user,OU=company,OU=location,OU=location...

From the posts i have read

on the LDAP user import field i have the script as such

ldapUtils.setManager(source, target);

// Set the source LDAP server into the target record

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

We also have an onStart script in the transform map

gs.include('LDAPUtils');  

var ldapUtils = new LDAPUtils();  

ldapUtils.setLog(log);  

and an onComplete script with

ldapUtils.processManagers();

i need helping with converting the hpw the manager information comes to be simply the name of the manager without all the AD information.

6 REPLIES 6

bernyalvarado
Mega Sage

Hi Carlos, here goes some pointers that will be helpful:



a) make sure that none of the fields that you're importing is getting truncated in either the import table or in the actual target table. This specially important for the fields which hold a DN


b) make sure you're not mapping the manager field in the   Field Map of the Transform Map. This is a common error. So common that ServiceNow added the below comment in the transform maps:



//


// The manager coming in from LDAP is the DN value for the manager.  


// The line of code below will locate the manager that matches the


// DN value and set it into the target record. To ignore the manager


// from LDAP, remove or comment out the line: ldapUtils.setManager(source, target);


//


// NOTE: The 'manager' field SHOULD NOT be mapped in the 'Field Maps' related list


// if the manager is brought in through an LDAP import.   The 'ldapUtils' scripts


// here and in the 'onComplete' Transform Map will map this value automatically.




Thanks,


Berny


Hi Carlos Lara, were you able to resolve your problem?



Please consider closing the thread if you feel that your question has been answered by marking the response as correct/helpful.



Thanks,


Berny


Yes, i did all of that.



It seems a script needs to be created to strip out with managers name out of attributes.


Hi Carlos, no. You shouldn't be required to do any further work. The OOB scripts that come with the Example LDAP will do the job for you (through LDAP utils).



If that doesn't work for you then you're having some imported value truncated. (as recommended in point a in the first post)



Thanks,


Berny