<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="font-family: -apple-system-font; line-height: 16px;" class=""><div class="">Hi,</div><div class="">I have an Active Directory resource and I need to reconcile users. In populating a virtual user attribute I need to check if the corresponding AD account has a particular group assigned. This is a snippet of the resource xml:</div></div><div style="font-family: -apple-system-font; line-height: 16px;" class=""><br class=""></div><div style="font-family: -apple-system-font; line-height: 16px;" class=""><div class="">                <attribute></div><div class="">                    <c:ref>ri:title</c:ref></div><div class="">                    <displayName>Gruppi</displayName></div><div class="">                    <inbound></div><div class="">                        <source></div><div class="">                            <name>gruppi</name></div><div class="">                            <path>$shadow/attributes/groups</path></div><div class="">                        </source>                        </div><div class="">                        <expression></div><div class="">                          <script></div><div class="">                             <code></div><div class="">                                def isdirettore = false</div><div class="">                                def n = gruppi.size()</div><div class="">                                for (def i = 0; i &lt; n; i++) {</div><div class="">                                    def gruppo = gruppi.get(i)</div><div class="">                                    if (it =~ /^CN=.*_DIV.._DIR.*$/) {</div><div class="">                                        isdirettore = true</div><div class="">                                    }</div><div class="">                                }</div><div class="">                                isdirettore</div><div class="">                             </code></div><div class="">                          </script></div><div class="">                        </expression></div><div class="">                        <target></div><div class="">                            <path>$user/extension/mise:organizzazione</path></div><div class="">                        </target></div><div class="">                    </inbound></div><div class="">                 </attribute></div></div><div style="font-family: -apple-system-font; line-height: 16px;" class=""><br class=""></div><div style="font-family: -apple-system-font; line-height: 16px;" class="">I need to loop on assigned AD groups and I need to check the string format of each group using a regular expression. The problem is that in the variable named “gruppi” I have only a string and not an array or List. Do you have any ideas?</div><div class=""><br class=""></div><div class="">Thanks and regards.</div><div class=""><br class=""></div><div class="">  Fabio</div><div class=""><br class=""></div><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><font size="1" class=""><span class="" style="font-family: 'Lucida Sans'; color: rgb(17, 52, 80); orphans: 2; widows: 2;">--</span><br class="" style="orphans: 2; widows: 2; color: rgb(17, 52, 80);"><span class="" style="font-family: 'Lucida Sans'; color: rgb(17, 52, 80); orphans: 2; widows: 2;">Fabio Contessi <<a href="mailto:f.contessi@nsr.it" class="">f.contessi@nsr.it</a></span><span class="" style="font-family: 'Lucida Sans'; color: rgb(17, 52, 80); orphans: 2; widows: 2;">></span><br class="" style="orphans: 2; widows: 2; color: rgb(17, 52, 80);"><br class="" style="orphans: 2; widows: 2; color: rgb(17, 52, 80);"><span class="" style="orphans: 2; widows: 2;"><font color="#015494" face="LucidaSans-Demi" class="">nova systems roma / nsr</font></span></font></div><div class=""><br class=""></div></div></div></div></div></div></body></html>