Mapping manager value from Active Directory (AD) integration

Community Alums
Not applicable

Hi All,

 

In AD, manager value is getting stored in an attribute called "userAttributeExtension15" which is storing some unique values here.

Currently, we are mapping the User ID and Email ID fields to the Email ID of the user.

Can anyone suggest me how I can map Manager value in the transform map.

 

Thank you in advance!

Regards,

Ganesh

 

1 ACCEPTED SOLUTION

David Whaley
Mega Sage

If this is for user imports you should have a manager field in your LDAP import set with the fully qualified domain name.  Something like CN= Full Name, OU = Group Name, OU=Users, DC= domain, DC=local.  You don't need to map the manager field in the transform map.  In the transform script enter the following ldapUtils.setManager(source, target);

 

This is what the out-of-the-box script looks like.

 

//
// 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.
ldapUtils.setManager(source, target);

 

 The OnComplete transform script

 

//
// It is possible that the manager for a user did not exist in the database when
// the user was processed and therefore we could not locate and set the manager field.
// The processManagers call below will find all those records for which a manager could
// not be found and attempt to locate the manager again.  This happens at the end of the
// import and therefore all users should have been created and we should be able to
// locate the manager at this point
ldapUtils.processManagers();

 

 

View solution in original post

16 REPLIES 16

Community Alums
Not applicable

Manager value is having "CN= Full Name, OU = Group Name, OU=Users, DC= domain, DC=local." this kind of data in it. 
When I load 20 records on the staging table, the manager value is populating but when I transform it right, that time manager value is not getting populated in servicenow user table

 

If manager value displays in the staging table better write simple transformation script like onComplete / OnBefore

target.manager = source.manager_field_name

and test it. If it works then something changed in OOB or error. Can you do the verification? But you should check the state of the staging table record is inserted / updated / pending / error.

I doubt, you will see the state called pending . If that is the case, its a known issue for 'Test 20 Load Record' UI action. Pls check the state in staging table.

 

For test purpose, click the 'Load All Records' as well. It will work. I experienced the same issue when I implemented the Discovery. 

Regards,
Suresh.

Community Alums
Not applicable

It makes sense. 

consider while loading 20 records, if manager user record is not present in those 20 user records, i think manager value is going to be empty right?
Because I have tried multiple times for loading 20 sample record but manager value is blank.

Seems link I need to try with full load and test it. Whats you thoughts on this. 

 

Thank you for your reply,

 

Regards,
Ganesh

You could go to one of your import sets with 20 records and modify one of the records without a manager and modify it as if it was a regular user pulled from LDAP and 'Reprocess' the import set. 

 

Have one browser window with a record from the test update set and another window with a record from a full load that has a manger and just copy and paste the values from that record to the test record.

 

Reprocess the test import set, check user record.

Hi, Yes, Your understanding is correct. Try with full load test and check the status. 

If helps my inputs can you mark as helpful or correct answer.

Regards,
Suresh.