Professional Documents
Culture Documents
GAM Cheat Sheet A3
GAM Cheat Sheet A3
DISCLAIMER: This is a reference sheet for people familiar with GAM and is provided “as-is”. You use it at your own risk! Always test commands before running them in a production environment.
https://gamcheatsheet.com/ gam@gamcheatsheet.com 1 © Copyright 2020 Glen Pringle Version 1.6.3, 20th August, 2020
Groups Email Aliases Classroom User Security Settings
gam create | update group <group email> gam create|update alias <alias> user|group|target gam create course id [alias <alias>] <CourseAttributes>
gam <who>|file <filename> <command>
<attributes/values> <primary address> gam update course <id or alias> <CourseAttributes>
where <command> is:
where attributes and values are: gam info alias <alias> where <CourseAttributes> is: show tokens (oauth tokens)
name <Group Name> gam delete alias [user|group|target] <alias> [name <name>] [section <section>] show token clientid <client id>
description <Group Description> gam <who> delete alias [teacher <teacher email>] delete token clientid <client id>
email <EmailAddress> gam print aliases [todrive] [heading <heading>] [description <description>] show asps (app-specific pwds)
admincreated true|false]
[room <room>] [status delete asp <ID>
allow_external_members true|false
message_moderation_level moderate_all_messages| <PROVISIONED|ACTIVE|ARCHIVED|DECLINED>] show backupcodes (2-step verification)
moderate_new_members|moderate_none| gam info|delete course <id or alias> update backupcodes
moderate_non_members delete backupcodes
primary_language <language> Domain Verification gam course <id or alias> <command>
where <command> is:
deprovision (remove tokens, asps,
reply_to and backupcodes)
gam create verify <domain> add student|teacher <email address>
reply_to_custom|reply_to_ignore|reply_to_list| gam update verify <domain> <cname|txt|site|file> gam print tokens [todrive] [clientid <ClientID>] <who>
reply_to_managers|reply_to_owner|reply_to_sender add|delete alias <alias>
gam info verify gam <who> show tokens
send_message_deny_notification true|false sync students|teachers group <group email> |ou
show_in_group_directory true|false <orgunit> | file <filename> |query <users query> | S/MIME
who_can_invite all_managers_can_invite|
all_members_can_invite
Domain Settings course <id or alias> gam user <email> add smime <file <filename>>
<password <password>> [default] [sendas <email>]
remove student|teacher <email address>
who_can_join gam info instance gam user <email> update smime [id <id>]
gam print courses [teacher <email>] [student <email>] [sendas <email>] <default>
all_in_domain_can_join|anyone_can_join| gam info domain|domainalias <domain>
can_request_to_join|invited_can_join [owneremail <email>] [state <states>] [todrive] gam user <email> delete smime <id <id>>
gam create domain <domain>
who_can_post_message all_in_domain_can_post| [aliases] [delimiter <String>] [sendas <email>]
gam create domainalias <domainalias>
all_managers_can_post|all_members_can_post| gam print course-participants [course <id or alias>] gam user <email> show|print smime primaryonly
<parentdomain>
anyone_can_post|none_can_post [student <email>] [teacher <email>] [show todrive
gam delete domain|domainalias <domain>
who_can_view_group all_in_domain_can_view| all|students|teachers] [todrive]
all_managers_can_view|all_members_can_view| gam print domains|domainaliases [todrive]
gam create guardianinvite <guardian email> <student
anyone_can_view gam update domain <domain> primary
email>
who_can_view_membership all_in_domain_can_view|
all_managers_can_view|all_members_can_view
gam delete guardian <guardian email> <student email> Reseller
gam show guardian [invitedguardian <guardian email>]
allow_google_communication true|false gam create|update resoldcustomer <domain>
allow_web_posting true|false [student <StudentItem>] [invitations] [states
[alternateemail <email>] [phone <phone>] [address1
<GuardianStateList>] [<UserTypeEntity>]
archive_only true|false
custom_reply_to <email address>
Various gam print guardians [invitations] [student <email>]
<address>] [address2 <address>] [address3
<address>] [contact <name>] [country <country>]
is_archived true|false gam version [simple|extended] [timeoffset] [invitedguardian <email>] [user <username>|group
max_message_bytes <integer> [city <city>] [organizationname <name>] [postalcode
[location] [check] <email>|ou <ouname>|all users] [nocsv] [todrive]
members_can_post_as_the_group true|false <code>] [region <region>] [transfertoken <token>]
gam version|help [states <GuardianStateList>]
message_display_font default_font|fixed_width_font gam info resoldcustomer <domain>
gam create|update project where GuardianStateList is:
spam_moderation_level allow|moderate| gam create resoldsubscription <domain> [dealcode
silently_moderate|reject gam whatis <user email> COMPLETE|PENDING| <code>] [plan <plan>] [purchaseorderid <po>]
include_in_global_address_list true|false GUARDIAN_INVITATION_STATE_UNSPECIFIED [seats <number> [max]] [sku <sku>] [transfertoken
who_can_leave_group none_can_leave| gam cancel guardianinvitation|guardianinvitations <token]
all_members_can_leave|all_managers_can_leave <GuardianInvitationID> <student email> gam update resoldsubscription <domain> <sku>
who_can_contact_owner anyone_can_contact|
[activate] [suspend] [startpaidservice] [renewal
all_in_domain_can_contact|
all_members_can_contact| all_managers_can_contact
Reports <renewaltype>] [seats <number> [max]] [plan
gam report users [todrive] [date <YYYY-MM-DD>] <plan> [seats <number> [max]] [purchaseorderid
gam info group <group email> [nousers] [noaliases]
[groups] [user <user email>] [filter <filter terms>] [fields
<included fields>]
Data Transfers <po>] [dealcode <code>]]
gam info resoldsubscriptions <domain> [transfertoken
gam update group <group email> add|update|sync
owner|member|manager gam report admin|calendar|logins| gam create datatransfer <old owner> gdrive|calendar <token>]
[allmail|nomail|daily|digest] [notsuspended] {user tokens|drive|groups|mobile [todrive] [user <user <new owner> [parameter <value>] gam delete resoldsubscription <domain> <sku>
<email address> | group <group address> |ou <org email> [filter <filter terms>] [ip <ip address>] [start gam info datatransfer <id> <deletiontype>
name> | file <file name> | all users} <start datetime>] [end <end datetime>] [event <event gam print datatransfers [oldowner <old owner>] To perform actions for a resold customer set following
gam update group <group email> clear [owner] [newowner <new owner>] [status completed|failed|
name>] environment variable and then run gam as per normal.
[manager] [member] inProgress|pending] [todrive]
gam update group <group email> remove {user <email where the filter specifies the search terms1. export CUSTOMER_ID=<customer id>
gam print transferapps
address> | group <group address> | org <org gam report usage user|customer parameters <comma
name> | file <file name> | all users} separated parameters> [start_date <YYYY-MM-DD>]
gam delete group <group email> gam <who> delete
[end_date <YYYY-MM-DD>] [orgunit <ou of users>]
group
gam print groups [domain <domain>] [member <user [skip_dates <YYYY-MM-DD>...] [skip_days_of_week Alerts
email>] [maxresults <results>] [name] [description] mon,tue...] [todrive] [users|group|csvfile] Admin Roles gam create alertfeedback <alertid> NOT_USEFUL|
[admincreated] [id] [aliases] [members] [owners] gam report domain [todrive] [date <YYYY-MM-DD>] gam create admin <user> <role> <customer|org_unit SOMEWHAT_USEFUL|VERY_USEFUL|
[managers] [settings] [todrive] [delimiter [fields <included fields>]
<delimchar>] [fields <list,of,fields>] <OU>> ALERT_FEEDBACK_TYPE_UNSPECIFIED
gam print group-members [group <group email>] <start datetime> and <end datetime> are in the format: gam delete admin <role assignment id> gam print alert|alertfeedback
[domain <domain>] [member <user email>] [fields YYYY-MM-DDThh:mm:ss.000Z gam print admins [user <user>] [role <role>] [todrive] gam delete|undelete alert <alertid>
<list,of,fields>] [membernames] [todrive] 1 https://developers.google.com/admin-sdk/reports/v1/reference/userUsageReport/get gam print roles [todrive]
DISCLAIMER: This is a reference sheet for people familiar with GAM and is provided “as-is”. You use it at your own risk! Always test commands before running them in a production environment.
https://gamcheatsheet.com/ gam@gamcheatsheet.com 2 © Copyright 2020 Glen Pringle Version 1.6.3, 20th August, 2020
Chrome Devices Licenses CloudPrint Bulk Operations
gam update cros <device id> [user <user info>] gam <who> add|delete license <sku> CloudPrint support has been dropped from GAM as of version 5.11 gam csv|csvtest <csv-filename> gam <regular
[location <location info>] [notes <notes info>] [ou gam <who> update license <sku> [from] <oldsku> as CloudPrint is deprecated and won't be available after 2020. command>
<new org unit>] [assetid <asset id>] [status gam print licenses [todrive] [products <product>]|[sku gam printer register Arguments starting with ~ will be substituted with the
active|deprovisioned|inactive|returnapproved|retur <sku>]|allskus|gsuite] [countsonly] gam update printer <id> [quotaEnabled <true|false>] value from the CSV row. For example:
where <sku> is: [dailyQuota <number>] [public <true|false> [name
nrequested|shipped|unknown] gam csv newusers.csv gam create user ~Email firstname
free|gafw|gafg|gams|gal|gau|gae|e4e|coordinate| <name>] [proxy <proxy>] [description
gam update cros <device id> action ~Firstname lastname ~Lastname password
vault|vfe|identity|identitypremium|coordinate|20gb <description>] [currentquota <Number>]
disable|reenable|deprovision_same_model_replace [defaultdisplayname <String>] [displayname ~Password gal off changepassword off org
|50gb|200gb|400gb|1tb|2tb|4tb|8tb|16tb|chrome
|deprovision_different_model_replace|deprovision_r <String>] [firmware <String>] [gcpversion <String>] Testing/Students
and <product> is: [istosaccepted <Boolean>] [manufacturer <String>]
etiring_device
Google-Apps|Google-Drive-storage|Google-Vault| Note that the ~ (tilde) character may need to be escaped
[acknowledge_device_touch_requirement] [model <String>] [ownerid <EmailAddress>] [status
Google-Coordinate|Google-Chrome-Device- <Number>]|[type <String>]|[uuid <String>]| in some environments.
gam info cros <device id> [nolists] [listlimit <Number>]
Management [setupurl|supporturl|updateurl <URL>]* Locally filter CSV output using the environment
[allfields|full|basic] [start <Date>] [end <Date>] gam info printer <id> [everything] variables GAM_CSV_HEADER_FILTER (comma-
<CrOSFieldName>* [fields <CrOSFieldNameList>] gam delete printer <id>
separated list of column headers) and
[downloadfile latest|<Time>] [targetfolder gam print printers [query <query>] [type <type>]
[status <status>] [extrafields <connectionStatus| GAM_CSV_ROW_FILTER (JSON string containing
<FilePath>]
gam print cros [query <query>|queries <query>+]
Custom User Schema semanticState|uiState|queuedJobsCount>] [todrive] column to filter on and value we want).
gam printer <id> <command> GAM_CSV_HEADER_DROP_FILTER removes listed
[orderby location|user|lastsync|serialnumber| gam create | update schema <schemaname> field
<fieldname> type where <command> is: headers from results.
supportenddate [ascending|descending] ]
add user|manager|owner <group or user email>| Run multiple gam commands from batch file:
[basic|full|allfields] [start <Date>] [end <Date>] <bool|double|email|int64|phone|string> [indexed]
[domain:]<DomainName>|public
[nolists|recentusers|timeranges|devicefiles] [restricted] [multivalued] [range <min number> gam batch <batch-filename>
remove <group or user email>|<domain>|public
<max number>] endfield showacl When the command “commit-batch” is found, all
[todrive] [listlimit <Number>] [limit_to_ou <OU>]
gam print|show schemas previous commands will be completed before execution
<CrOSFieldName>* [fields <CrOSFieldNameList>] gam printjob <printer id> submit <file or url> [title
gam info schema <schemaname> <string>] [tag <string>]
gam print crosactivity [query <query>|queries continues.
gam delete schema <schemaname> gam printjob <id> cancel|delete
<query>+] [todrive] [limittoou <OU>] [recentusers]
gam printjob <PrintJobID> resubmit <PrinterID>
[timeranges] [both] [devicefiles] [all] [listlimit gam printjob <PrinterID>|any fetch [olderthan|
<limit>] [delimiter <char>] [start <yyyy-mm-dd>] newerthan <number><m|h|d>] [query <query>]
[end <yyyy-mm-dd>] [status done|error|in_progress|queued|submitted| Parallel Commands
Vault held] [orderby create_time|status|title] [owner <user For both csv and batch commands, GAM will run
gam create vaultmatter [name <name>] [description email>] [limit <number>] [ascending|descending]
Mobile Devices <description>] [collaborators <emails>] gam print printjobs [older_than <number><m|h|d>]
multiple actions in parallel. By default, GAM starts 5
[newer_than <number><m|h|d>] [query <query>] worker threads and can run 5 commands at a time. You
gam update mobile <mobile id>|query:<query> action gam update vaultmatter <nameOrId> [name <name>]
[status <status>] [printer <printer id>] [owner <user can raise or lower this setting by setting an environment
wipe|approve|block| [description <description>] [addcollaborators
email>] [limit <number>] [orderby create_time| variable called GAM_THREADS.
cancel_remote_wipe_then_activate| <emails>] [removecollaborators <emails>] [action
status|title] [ascending|descending] [todrive]
cancel_remote_wipe_then_block [model <String>] close|reopen|delete|undelete] gam info vaultmatter Going much higher than 20 threads is not recommended
[os <String>] [useragent <String>] <nameOrId> or you’re likely to see issues with Google API quotas.
gam info mobile <mobile id> gam print vaultmatters [todrive] [basic] gam create
gam print mobile [query <query>][basic|full] [orderby vaulthold <matter nameOrId> [name <name>]
deviceid|email|lastsync| [corpus mail|drive|groups] [query <query>]
[accounts <emails>] [orgunit <orgunit>] [starttime
Customer
model|name|os|status|type]
gam info customer
[ascending|descending] [todrive] YYYY-MM-DD] [endtime YYYY-MM-DD]
gam update hold <HoldNameOrId> <matter gam update customer [alternateemail <EmailAddress>]
OAuth Key Management
gam delete mobile <mobile id>
<MatterNameOrId>> [query <query>] [orgunit [language <LanguageCode] [phone <String>] Set the variable OAUTHFILE in your shell to the file
<orgunit>] [addaccounts <emails>] [removeaccounts [organizationname <String>] [contactname <String>] containing the OAuth credentials and the variable
<emails>] [starttime YYYY-MM-DD] [endtime YYYY- [countrycode <String> [addressline1 <String>] OAUTHSERVICEFILE to the file containing the service
MM-DD] [addressline2 <String>] [addressline3 <String>] account JSON key. The file must be in the same folder as
gam info|delete vaulthold <HoldNameOrId> matter [locality <String>] [region <String>] [postalcode
gam.exe/gam.py or contain a path relative to this folder.
<MatterNameOrId> <String>] [countrycode <String>]
Organizational Units gam print vaultholds [matters <matters>] [todrive] gam gam oauth info [<access token>]
gam create org <name> [description <Description>] create export [matter <matter>] [name <name>] gam oauth create [<EmailAddress>]
[parent <Parent Org>] [inherit|noinherit] [corpus <drive|mail|groups|hangouts_chat>] [scope gam oauth create [admin <EmailAddress>]
gam update org <name> [name <Name>] [description <all_data|held_data|unprocessed_data>] [accounts Definitions [scope|scopes <APIScopeURLList>]
<Description>] [parent <Parent>] [inherit|noinherit] <emails> | orgunit <orgunit>|teamdrives gam oauth revoke
<who> user <user email>|group <group
gam update org <name> add|move users <Users>| <teamdrives> | rooms <rooms> | everyone] [terms gam show sakey [all|system|user]
email>|ou <ouname>|all users
file <File Name>|group <Group Name>|all cros <terms>] [start <date>] [end <date>] [timezone gam rotate sakey [local_key_size <1024|2048|4096>]
<datetime> RFC3339 formatted date and time,
|cros <device id> <timezone>] [format mbox|pst] [excludedrafts [retain_none|retain_existing|replace_current]
e.g. YYYY-MM-DDThh:mm:ss.000Z
gam info org <name> [nousers|child] true|false] [driveversiondate <date>] [algorithm KEY_ALG_RSA_1024|
gam delete org <name> [includeteamdrives] [includerooms] <user email> is a user in the domain
KEY_ALG_RSA_2048]
gam print orgs [todrive] [toplevelonly] [fromparent [includeaccessinfo true|false] <group email> is a group in the domain
gam delete sakeys <key_ids> [doit]
<name>] [allfields|<list of fields>] gam info|download export <matter> <export> <email address> is any email address
DISCLAIMER: This is a reference sheet for people familiar with GAM and is provided “as-is”. You use it at your own risk! Always test commands before running them in a production environment.
https://gamcheatsheet.com/ gam@gamcheatsheet.com 3 © Copyright 2020 Glen Pringle Version 1.6.3, 20th August, 2020
Environment Variables
The following environment variables are supported.
GAMUSERCONFIGDIR
GAMSITECONFIGDIR
GAMCACHEDIR
GAMDRIVEDIR
OAUTHFILE
OAUTHSERVICEFILE
CLIENTSECRETS
GA_DOMAIN
CUSTOMER_ID
GAM_CHARSET
GAM_THREADS
GAM_AUTOBATCH
GAM_BATCH_SIZE
GAM_CSV_HEADER_FILTER
GAM_CSV_HEADER_DROP_FILTER
GAM_CSV_ROW_FILTER
GAM_TLS_MIN_VERSION
GAM_TLS_MAX_VERSION
GAM_CA_FILE
DISCLAIMER: This is a reference sheet for people familiar with GAM and is provided “as-is”. You use it at your own risk! Always test commands before running them in a production environment.
https://gamcheatsheet.com/ gam@gamcheatsheet.com 4 © Copyright 2020 Glen Pringle Version 1.6.3, 20th August, 2020