You can easily nest things by using the other LDAP commands in the package. For example, using
|ldapsearch domain="X" search="(CN=#*)" attrs="distinguishedName"|ldapgroup
You get an expansion that actually shows the membership in a field called memberDN. You can expand this with ldapfetch:
|ldapsearch domain="X" search="(CN=#*)" attrs="distinguishedName"|ldapgroup|mvexpand memberdn|table cn,memberdn|ldapfetch dn=memberdn attrs="mail"|table cn,memberdn,mail
Check out the specific documentation within the SA-ldapsearch app, that has explicit examples for each of the four commands.
... View more