- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2018 08:09 PM
Hi all,
I'm attempting to create an LDAP import transform script that will prevent the import / update of users that meet certain criteria.
I've got the criteria defined within a function excludeUser( target.user_name ) that returns either a 1 or a 0 depending on whether user is to be excluded or not. This function is behaving itself.
Where I'm coming unstuck is determining the exact statement required to actually stop the user record from being imported / updated.
From the documentation, I believe all I'm supposed to do is add the following statement into my transform script:
user_name='';
This isn't having the desired effect. The user record to exclude from LDAP import is still being updated.
My code essentially look like this:
var user = target.sys_id;
if(excludeUser(target.user_name))
{
user_name='';
}
function excludeUser(uname)
{
// Code for determining whether uname is to be excluded from LDAP import
// Return 1 for true
// Return 0 for false
}
I've tried a couple of variants of the user_name=''; statement:
source.user_name='';
source.u_samaccountname=''; <-- The transform field map's source field name
target.user_name=''; <-- this blanked the user record's User ID field!!!!
Hope I'm making myself clear with what I'm trying to achieve. I feel as if I'm close but there's something obvious I'm missing.
Any suggestions?
Cheers.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2018 08:30 PM
I use the following code to ignore an insert of a new LDAP user:
if (action == "insert")
ignore = true;
I think you need to use the ignore = true in your statement to skip that record.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2018 08:30 PM
I use the following code to ignore an insert of a new LDAP user:
if (action == "insert")
ignore = true;
I think you need to use the ignore = true in your statement to skip that record.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 05:47 PM
Thanks, that looks like it's done the trick!