GAM is an open-source command-line tool that streamlines the management of objects within the Google Admin console. Detailed documentation for GAM can be found on its GitHub Wiki. The link is from the standard GAM, for installing we recommend installing GAM advanced version. The various options available with GAM are organized into specific sections on the right-hand side of the Wiki. The capabilities available to a Google Workspace for Education admin using GAM are extensive.
Setting Up GAM
Comprehensive setup instructions are provided in the documentation. However, if you encounter any issues, don’t hesitate to contact us.
If you have hours remaining on a support subscription, you are one step closer to accessing the GAM: Getting Started Support Stack.
The best way to reach support is to enter a support ticket through the Help Center. Here's the direct Submit a ticket link, which is available at the top of every Help Center page. You can also connect with our support team by emailing support@amplifiedit.cdw.com.
If you want to obtain a support contract or have questions, reach out to a Google Customer Support Specialist.
Learn more about the various ways we can help your team.
To purchase support hours, contact a Google Customer Support Specialist.
Some examples that may be relevant during the school year are covered below.
GAM Single Use Cases
GAM excels when used with its own output or CSV files. More detailed information can be found here. Below are some practical examples relevant during the school year.
Example: Hiding All Groups from the Global Address List
To hide all groups from the Global Address List in Google Workspace, first, print out a list of groups:
gam print groups > groups.csv
Then, run a bulk command using the groups.csv file as input:
gam csv groups.csv gam update group ~Email includeInGlobalAddressList false
Explanation:
- gam csv groups.csv informs GAM to use groups.csv as the input file.
- The CSV file should have a column header Email and each row should contain a group email address.
- gam update group ~Email includeInGlobalAddressList false is the command to update each group. The ~ (tilde) indicates a column header in the CSV.
Note: Column headers are case-sensitive.
Example: Piping Commands
For faster execution, you can pipe the output of one GAM command into another using the | character. For instance:
gam print groups | gam csv – gam update group ~Email includeInGlobalAddressList true
This command prints a list of groups in CSV format and pipes it back into GAM. GAM then updates each group to be included in the Global Address List.
Useful Commands
Bulk Changes to Groups Based on CSV Input
To obtain a list of groups:
gam print groups allfields > c:\DestinationFolder\GroupsExport.csv
You can then modify the columns in this CSV using Excel or Google Sheets and pipe it back into GAM:
gam csv alteredcsvfile.csv gam update group ~Email "SettingToBeAltered" ~"SettingColumnHeader"
gam csv alteredcsvfile.csv gam update group ~"Email" include_in_global_address_list ~"includeInGlobalAddressList" show_in_group_directory ~"showingroupdirectory"
This will hide all groups from the Global Address List and the Groups directory.
Moving Suspended Users to a Specific OrgUnit
To move all suspended users to a specific OrgUnit:
gam print users query "isSuspended=true orgUnitPath=/Student" | gam csv – gam update user "~primaryEmail" ou /Suspended/Students gal off
This command finds suspended users in the /Student OrgUnit and moves them to the /Suspended/Students OrgUnit, hiding them from the directory.
Conclusion
This is just a small sample of GAM’s capabilities. Consider the daily pain points you encounter while managing your Admin console. GAM can likely help automate these tasks if there is an API endpoint available.
Document Version | Date | Description of Change |
1.0 | 7/11/2024 | Rewrote text, reverified. |
1.2 | 7/31/2024 | Updated email address. |
1.3 | 8/13/2024 | Published after T.Groff edits - email address reverting issue |
1.4 | 8/16/2024 | Removed duplicate text, added content block for email |