I get distinguished name values from a script to send in an email:

The script I use in the email activity is the following:

function printOut(){
var rooms1=flowdata.getObject('start/CreatUser/SensitiveZone1');
var resultStr = "";
for(x = 0; x < rooms1.size(); x++ ) {
resultStr = resultStr + "&#x274f&nbsp" +
(rooms1.get(x).getFirstChild().getNodeValue()) + "<br/>";
return resultStr;

Then the values in the email are:

❏ cn=room2,ou=Facilities
Zones,l=xxxx,ou=Locations,ou=LISTS,ou=SERVICES,o=S YSTEMS
❏ cn=room1,ou=Facilities
Zones,l=xxxx,ou=Locations,ou=LISTS,ou=SERVICES,o=S YSTEMS

This content is fine, but not nice, I 'd like to keep only the room
name, like room2 or room1 in the list.

I tried to apply a match(RegEx) or different substring combination, but
does not work. The match gives always script error.

examples I tried :
resultStr = resultStr + "&#x274f&nbsp" +
(rooms1.get(x).getFirstChild().getNodeValue()).mat ch((?<=cn=)(.*?)(?=,ou))
+ "<br/>";
resultStr = resultStr + "&#x274f&nbsp" +
(rooms1.get(x).getFirstChild().getNodeValue()).sub string(3,
resultStr.length - 80) + "<br/>";

Also I cannot find any object to get the CN from the DN...

Thanks for any suggestion.


sma's Profile: https://forums.netiq.com/member.php?userid=174
View this thread: https://forums.netiq.com/showthread.php?t=54793