# for i in 0 1 2; do ldapsearch -x -LLL -h ldap${i} -b "ou=Group,dc=spack,dc=org" "memberUid=adam" cn | sort | awk -F: '/^cn: /{printf $2}'; echo; done
Print out a one line list of all the groups that the user adam belongs to via direct query to each of the servers ldap{0,1,2}.