LDAP ignore import of accounts with no email address

Brendan Hallida
Kilo Guru

Hi all,

I am trying to refine our nightly LDAP user import, and would like to ignore any ad account that does not have an email address, and not create a ServiceNow account.

To be honest, I am not actually sure where to start.   Googling didnt help me much either, but that could be on me, rather than the answer not being out there.

Does anyone know of an easy way to implement this?

Cheers,

Brendan

EDIT - For people looking at this from the future.

  1. Firstly, you are welcome.
  2. I was able to get this working with an LDAP OU Definitions filter.   basically, you want to append (mail=*) to your existing filter(s)
  3. Example Filter: (&(objectClass=person)(sn=*)(!(objectClass=computer))(!(CN=*@*))(!(CN=*Account*))(mail=*))
1 ACCEPTED SOLUTION

Filter way is best...I was about to suggest the same. No need to use Business Rule. Business rule is useful when you looking for some complex scenarios


View solution in original post

5 REPLIES 5

drasamsetti
Kilo Expert

Hi Brendan,



you can achieve this using onbefore transform script, check for source record email address and if it is empty and the operation is insert then set the ignore flag true.



if (action == 'insert') ignore = true;



Regards,


Durga.


Hi Durga,



Thanks for getting back to me.



Im not completely following, do you happen to have an example I can work off?



Cheers,Brendan


Open Transform Map. Click Transform Scripts, Click On-before.



if (source.u_mail == '' && (action == 'insert'))


{


ignore= true;    


}



find_real_file.png


Hi Rajeev,



Thanks for that - seems simple enough.



I have just been testing with the LDAP OU Definitions, and filtering accounts without an email address from there.



I was successful after adding the following filter: (mail=*).   This tells the import to only allow users with an email address.



My question is - what is the best way to do it?   the filter way has worked, and I cannot see any issues with it, however if people are suggesting to use a transform map, then why would that be better than stopping the accounts coming through at the filter stage?



Cheers,


Brendan