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.
- 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
- 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
- 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:
email@example.com,2,firstname.lastname@example.org,email@example.com means that sususer01 & 02 are suspended accounts that are still members of the group groupname.
gam print groups members suspended
- Remove Suspended Users from all groups: Along with the previous tip, to remove a user from all groups, just use:
gam user firstname.lastname@example.org delete groups
- 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:
[faculty]Then create sub-folders faculty and students. In each folder, place the respective client_secrets.json and oauth2service.json files.
domain = facultydomain.edu
customer_id = facultyDomainCustomerID#
config_dir = faculty
domain = studentdomain.edu
customer_id = studentDomainCustomer#
config_dir = students