Forum Discussion
MXV_164448
Nimbostratus
Mar 30, 2015Active directory retrieve memberof group CN
Hi,
How can I retrieve the group common name from a AD Query ?
I can't find any info except how to get DN of groups
Thanks
Max
Stanislas_Piro2
Cumulonimbus
Sep 21, 2015Hi,
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects