I'm trying to achieve the same thing as LouiSe tried half a year ago. I'm also looking for any advice that will direct me in the right way. As I understand it, People API isn't exactly cut out for this, since there's no easy way of listing all the groups. So, Java backed Web Script is also an option; something like this: