Need to exclude specific OU from LDAP

Abhit
Tera Guru

Hi All, 

I need to get all groups from LDAP node, but I have to a group OU=ServiceNow

Filter: (&(objectclass=group)(!(OU=ServiceNow)))

find_real_file.png

But after importing the group still i can see the group with OU=ServiceNow. 

Thanks

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

I had similar requirements so I added below script on Transform Map to ignore those groups from importing.

if(source.u_dn.indexOf("OU=ServiceNow") > -1){
	ignore = true;
}

Once the group is created in SN you will have to delete it before running the job.

View solution in original post

14 REPLIES 14

Hi,

in that case then handle this using onBefore transform script

Sample script below

var incomingGroupName = source.<importSetFieldName>;

if(incomingGroupName.indexOf("OU=ServiceNow") > -1){
	ignore = true;
}

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

I have similar requirement as I want to remove test 0U data but in production service now instance only, Is there any way to appear the data in dev and UAT environment only ?

As I mentioned, importing it to staging table and using trasform map will work. 

Hi Mike,

I have similar requirement as I want to remove test 0U data but in production service now instance only, Is there any way to appear the data in dev and UAT environment only ?

You can add something like below in Transform Map script section

if (gs.getProperty('instance_name') === 'prod' && source.u_dn.indexOf("OU=test") > -1) {
    ignore = true;
}