Forum Discussion
Stanislas_Piro2
Sep 21, 2015Cumulonimbus
Hi,
you can retrieve CN value of memberof attribute with a variable assign:
if { [info exists "groups"] }{unset groups;};
foreach value [mcget {session.ad.last.attr.memberOf}] {
regexp {CN=([^,]+)} $value CNFull CNValue;
lappend groups $CNValue;
unset CNFull;
unset CNValue;
};
return $groups
This tcl code will split groups, search the first CN in each group and create a new multivalued variable.
With a group named CN=My Group Name, CN=Users, OU=IT, DC=company, DC=local
- variable CNFull contains the group name as CN=My group Name
- variable CNValue contains the group name as My group Name