Getting started with Google Apps Manager (GAM)
What is GAM?
“With GAM you can change the password of 100+ users in a matter of seconds.”
Google Apps Manager (or simply GAM) is a command-line tool that helps with automation and bulk operations. It’s also able to give you valuable insights into your Google Workspace instance.
As a sysadmin, you may want to use GAM to:
- create, edit, or delete users, groups, organizational units (OUs)
- monitor Google Workspace activities
- move, modify, or delete files
- … and much more
You might already be using the Google Admin Console to carry out some of these tasks, but eventually, you’ll realize that some tasks are simply too time-consuming to manually carry out. That’s when GAM steps in.
For example, imagine how much time it’d take you to change the password of 100+ users in the Google Admin Console, or if you’d have to check how many Google Workspace licenses are currently being used/unused. With GAM you can do this in a matter of seconds.
GAM must be installed on a PC, Linux, or Mac. Please note that you must have admin access to the Google Admin Console, as you’re required to authorize and grant GAM with API permissions.
- Visit https://github.com/jay0lee/GAM/wiki#download-gam
- Select the version compatible with your operating system (OS)
- Follow the guided instructions (as shown in the video below)
Once installed, open your command-line tool and execute these 3 commands in the following order:
- Gam create project
- (This creates a GCP project to enable the API access needed for later execution of the GAM commands)
- Gam oauth create
- (This checks and creates the right authentication needed for later execution of the GAM commands)
- Gam user email@example.com check serviceaccount
- (This checks and creates the API access needed in Google Workspace. Note: The firstname.lastname@example.org must be replaced with your Google Workspace email)
Congratulations, you have successfully installed GAM. Here are some scripts you can try running in your command-line tool:
- Gam print users todrive
- (This script lists all Google Workspace users from your organization into a newly created Google Sheet, which can be accessed from your Google Drive)
- Gam print users allfields licenses todrive
- (Similar to the first script, you’ll get a Google Sheet of all Google Workspace users including information like first name, last name, last login time, and the types of licenses assigned to them)
- Gam print groups allfields members owners manager todrive
- (This script lists all groups including the settings, members, owners, and managers to a Google Sheet which can be accessed from your Google Drive)
Knowing all GAM commands can be difficult at first, so here’s a cheat sheet to help you get started: https://gamcheatsheet.com/