GAM – Google Apps Manager

GAMADV-xtd3 is a command-line tool for managing Google domains and it works very well for many things. This is a list of some tasks I use from time-to-time.

  1. Put users into an OU. The target OU in this case is iPads – Pangyo, a subgroup of our Organizational Emails OU. I put a list of usernames into a text file (ipads.txt) saved in my GAM folder and ran the following in Terminal:
    gam update org "Organizational Emails/iPads - Pangyo" add file ipads.txt
  2. Suspend Google accounts of departed faculty: create a one-column file departed.csv with header Email containing departed faculty email addresses.
    gam csv gam update user ~Email suspended true
  3. Find all groups with suspended users: We notice that suspended users still show up in mail groups. In order to identify and remove them, the following will list all groups followed by the number (and emails) of suspended accounts still appearing in each group. In the latter list, if one sees something like:,2,,
    this means that sususer01 & 02 are suspended accounts that are still members of the group groupname.
    gam print groups members suspended
  4. Remove Suspended Users from all groups: Along with the previous tip, to remove a user from all groups, just use:
    gam user delete groups
  5. Using GAM with Multiple Domains: I use GAMADV-XTD3 with two Google domains. Once one is set up, the other can be added by editing the gam.cfg file to have the following lines at the end:
    domain =
    customer_id = facultyDomainCustomerID#
    config_dir = faculty

    domain =
    customer_id = studentDomainCustomer#
    config_dir = students
    Then create sub-folders faculty and students. In each folder, place the respective client_secrets.json and oauth2service.json files.

Banning Google Group Members from Receiving Email

At KIS, we assign our school-owned iPads Google accounts. But since they’re in our staff domain, they’re automatically added to our allstaff email group and receive all the email sent to that group. We don’t want these emails to show up in the iPad mail app and needed a way to remove those addresses from the group mail list. This is the method we use:

First access Google Groups Service for the allstaff group by selecting the group in the Google Admin Control Panel, clicking “Manage users in allstaff” and clicking “View in Groups service”.  On the next screen, click on the Manage link.

On the left-hand menu, select Direct add members.

Add the accounts you wish to eliminate from the list.


Select those recently added members and from the Actions menu select Ban.