I use the GAM tool a lot to make updates to the Google domain at Streetsboro – it let’s me do things faster, and more efficiently that hitting each user in the domain admin panel.
But, using a Mac brings its own issues, and while I could get a PC for this, I’ve just figured out how to do things on the Mac.
Here’s how I run batch commands (to update hundreds of accounts in one go).
- Create the GAM command line
- Start with a spreadsheet that contains all the users’ emails you want to use / update.
- I use Google sheets, and usually use the =CONCATENATE or some other formula to create the command line for each account.
- Something like =CONCATENATE(“gam update user “,A1,” org /STAFF”), where A1=user account / email address.
- For example, to add the user to a specific org unit, your GAM command line might look like:
gam update user asmith@email.com org /STAFF
- I copy the resulting command lines (the whole column), and paste into a new sheet, with Paste Special > Paste as Values Only…
- Download as resulting sheet as a .csv file
- Place the file in the GAM folder –> in my case, in /bin/gam <– but, this depends on your GAM install!
- Rename the file to end in .sh <– for shell
- Your file should now be something like staffupdate.sh
- In Terminal on the Mac, run this command, making sure to point to the file:
gam batch bin/gam/staffupdate.sh
- Terminal will now run the shell file as a batch, and run all the GAM commands for you!
- Done!
