If you're using GAMADV-XTD3, you can run this command: gam config auto_batch_min 1 redirect csv - multiprocess all users print groups countsonly
Replace "csv -" with "csv ./usergroupcounts.csv" or your preferred file name to print the output to a file. This command will generate output that looks like this, showing the number of groups that each user is a member, manager, or owner of:
User,MEMBER,MANAGER,OWNER
user1@domain,0,0,0
user2@domain,1,0,0
user3@domain,1,0,0
user4@domain,15,0,2
This might not be as efficient as the python script that Brian posted, but it will likely work quickly enough. If you want GAM to only list users that are not members of any group, then you can have GAM filter the output for you:
gam config auto_batch_min 1 csv_output_row_filter "MEMBER:count=0,MANAGER:count=0,OWNER:count=0" redirect csv - multiprocess all users print groups countsonly