chain commands

90 views
Skip to first unread message

Roee Ninyo

unread,
Jun 1, 2022, 10:06:04 AM6/1/22
to GAM for Google Workspace
how do i chain two commands? like: 
gam update user and gam update group beatles add manager user rst...@beatles.com

IndianaNetworkAdmin

unread,
Jun 1, 2022, 10:50:30 AM6/1/22
to GAM for Google Workspace

What do you mean by chain? You can do batch commands where you put everything together and have them run in a specific order. i.e.

Text file commands.txt contains:

gam create user ....
gam create user ....
commit-batch
gam update user ...
gam update group <> add manager user <>


Then the command:
gam batch .\commands.txt

This will use multiple processes/threads to create the users simultaneously, but it won't run the next set of commands until everything above commit-batch has been completed.

Note that I use gamadv-xtd3 for everything. I don't recall if it's available in Jay's GAM.

If you have an example of what you're trying to accomplish, I can try to be more help.

Kim Nilsson

unread,
Jun 5, 2022, 2:16:15 AM6/5/22
to GAM for Google Workspace
In Linux you just put && between the commands.

gam update user && gam update group beatles add manager user user@email

That means run the first command till it's done, then run the second.

Roee Ninyo

unread,
Jun 9, 2022, 8:35:02 AM6/9/22
to GAM for Google Workspace
Thanks all!
Reply all
Reply to author
Forward
0 new messages