How to get started with Google Apps Manager (GAM)
Let’s Quickly talk about GAM – What is it?
The Google Apps Manager (or just GAM) is a command-line tool for automation and bulk operations for Google Workspace administrators. Once you start working with GAM and start using GAM scripts, you can also save some of those scripts that do things for your organisation. You can reset the entire company’s passwords or rename your domain with a single script. In short, you can do very, very powerful things very, very fast. In addition, it can provide you with valuable insights into your Google Workspace instance.
However it should be noted that while GAM is extremely powerful, “with great power, comes great responsibility”, and it very easy to damage your Google Workspace environment if you don’t know exactly what you are doing. Hopefully this quick introduction will allow you to experiment with GAM in a controlled manner. Below is a quick introduction to how you can use GAM and simplify a lot of administrative tasks.
Why Do You Need GAM?
You may want to use GAM as a system administrator to manually run bulk operations like:
- Edit, create, or delete users, groups, or organisational units (OUs)
- Keep track of Google Workspace activities
- Delete, move, or modify files
- As well as many other things
It’s likely that you already use the Google Admin Console to handle some of these tasks, but eventually, you’ll find that some tasks are too time-consuming to handle manually via clicks. GAM is there to help in these situations. Suppose you’re an IT administrator for a school or university. In that case, you can imagine how long it would take to suspend 100+ users passing out each year from the Google Admin Console or how long it would take to check how many Google Workspace licenses are active and being used. By using GAM, you can accomplish this in a matter of seconds.
Setting up GAM
- The GAM software can be installed on most common operating systems, including Windows, Linux and MacOS. Please Note: To authorise and grant API permissions to GAM, you must have admin access to the Google Admin Console.
- To download GAM, visit this link – https://github.com/jay0lee/GAM/ or you may want to download the enhanced version of GAM from https://github.com/taers232c/GAMADV-XTD3
- Choose the version that is compatible with your operating system (OS).
- The video below explains how to follow the guided instructions. – https://www.youtube.com/watch?v=RQD7jeR4rss
Creating A Configuration for Your GAM Installation
After installing, open your command-line tool and run these three commands in the specified order:
- Gam create project (This command creates a GCP project to enable API access needed for later execution of GAM commands.)
- Gam oauth create (This checks and creates the right authentication needed for the later execution of GAM commands).
- Gam user firstname.lastname@example.org check serviceaccount (This command checks and creates API access in Google Workspace. Replace email@example.com with your Google Workspace email address.)
Commonly Used Scripts
Congratulations, you have successfully installed GAM. You can now try running these scripts in your command-line tool:
- Gam print users todrive
(The script lists every Google Workspace user in your organisation in a Google Sheet that can be accessed from your Google Drive.)
- Gam print users allfields licenses todrive
(This script will generate a Google Sheet of all Google Workspace users, including their first and last names, last login times, and license types.)
- Gam print groups allfields members, owners manager todrive
(This script creates a Google Sheet with all groups’ data with information such as settings, members, owners, managers, etc. You can access the Google Sheet from your Google Drive account.)
GAMADV Project Home Page: https://github.com/taers232c/GAMADV-XTD3
GAM Scripts: https://github.com/taers232c/GAM-Scripts3
Others’ Contributions: https://github.com/taers232c/GAMADV-XTD3/wiki/Other-Resources
GAM cheat sheet for you – https://gamcheatsheet.com/
GAM Discussion Group: https://groups.google.com/g/google-apps-manager
The original GAM: https://github.com/jay0lee/GAM