- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2015 03:35 PM
I'm trying to write this transform script but I'm not sure if this is correct.
The goal is to restrict inserts for accounts that contain "Mail Accounts" in AD.
if((source.u_distinguishedName.toLowerCase().indexOf('Mail Accounts') > -1 && action == 'insert'))
ignore = true;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2015 12:36 PM
OK,
So I was able to re-verify this after multiple runs. I wasn't accounting for that fact that it was working when I saw zero inserts when I was expecting a few hundred. There were records already accounted for which I did not delete.
The script I first used was close and but failed to realize that the distinguished name field in the import table is all lowercase.
Run onBefore
if (source.u_distinguishedname.toString().indexOf('OU=Mail Accounts') > -1) {
ignore = true;}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2015 10:15 PM
Since you have converted the string to lowercase already, the comparison string should be specified in lower case
if((source.u_distinguishedName.toLowerCase().indexOf('mail accounts') > -1 && action == 'insert'))
ignore = true;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2015 11:52 AM
Weirdly, this doesn't seem to work. I re-ran the transform and it still pulled the accounts in.
I've tried a few variations but my changes don't seem to work.
My current iteration is
if (source.u_distinguishedname.toString().indexOf('OU=Mail') != -1) {
ignore = true;}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2015 12:36 PM
OK,
So I was able to re-verify this after multiple runs. I wasn't accounting for that fact that it was working when I saw zero inserts when I was expecting a few hundred. There were records already accounted for which I did not delete.
The script I first used was close and but failed to realize that the distinguished name field in the import table is all lowercase.
Run onBefore
if (source.u_distinguishedname.toString().indexOf('OU=Mail Accounts') > -1) {
ignore = true;}