Adding a large number of users to a single group? batch or csv multiple process

46 views
Skip to first unread message

Duncan Nash

unread,
Mar 3, 2026, 1:10:09 AM (4 days ago) Mar 3
to GAM for Google Workspace
Hi there,
I have to add 20k + users to a single group.

I normally have have the num_threads = 5

Now I would normally use:

gam redirect stdout .\add_users_to_group_out.txt multiprocess csv .\users_to_add.csv gam update group myg...@mydomain.com add member user ~userEmail

doing it via batch seems to be recommended 

gam config batch_size 20 inter_batch_wait 1 update group test...@domain.com add members file users.lst

So I'm just trying to work out which would be more efficient and not run the risk of hitting quota limits 

Regards
Duncan

Windows 11
GAM v7.33.00

Jay Lee

unread,
Mar 3, 2026, 5:22:07 AM (3 days ago) Mar 3
to google-ap...@googlegroups.com
Use "gam update cigroup" commands which use the Cloud Identity API. It's orders of magnitude faster.

You'll need to experiment with batch and threads to find the right balance for your environment. 

Jay Lee 

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-manager/ddda16fa-431d-4634-826c-90369f4e7196n%40googlegroups.com.

Ross Scroggs

unread,
Mar 3, 2026, 12:25:56 PM (3 days ago) Mar 3
to google-ap...@googlegroups.com
This will make 20,000 Directory API calls, 20 at a time in parallel
gam config num_threads 20 redirect stdout .\add_users_to_group_out.txt multiprocess redirect stderr stdout csv .\users_to_add.csv gam update group myg...@mydomain.com add member user ~userEmail

This will make 20,000 Cloud Identity API calls, 20 at a time in parallel
gam config num_threads 20 redirect stdout .\add_users_to_group_out.txt multiprocess redirect stderr stdout csv .\users_to_add.csv gam update cigroup myg...@mydomain.com add member user ~userEmail

This will make 1,000 Directory API calls, 1 at a time, 20 users per API call

gam config batch_size 20 inter_batch_wait 1 redirect stdout .\add_users_to_group_out.txt redirect stderr stdout update group test...@domain.com add members csvfile .\users_to_add.csv:userEmail


Ross


--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-manager/ddda16fa-431d-4634-826c-90369f4e7196n%40googlegroups.com.


--

Duncan Nash

unread,
Mar 4, 2026, 4:13:48 PM (2 days ago) Mar 4
to GAM for Google Workspace
Hi Ross,
thanks for explaining the differences. And just to close the loop on this I used..

gam config num_threads 20 redirect stdout .\add_users_to_group_out.txt multiprocess redirect stderr stdout csv .\users_to_add.csv gam update group myg...@mydomain.com add member user ~userEmail

and to add 39k users to the group took just over 1 hour, with no back off errors. However this was done on a virtual desktop with a very good network connectivity.

Duncan Nash 
Reply all
Reply to author
Forward
0 new messages