Using the API to do this would work like this:
The groups piece would be 2 calls.
List the groups available in a context.
GET /api/v1/courses/:course_id/groups
This will give you a list of groups for a course.
Then you plug in the ID to get the Group Memeber ship.
List Group membership
GET /api/v1/groups/:group_id/memberships
{Needs a group ID}
Get the list of enrollments for the course.
GET /api/v1/courses/:course_id/enrollments
Then you could compare the enrollments list to the membership list.
Attached is a Windows Powershell script to do that.
It only gives student name and group name to a csv file.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.