Professional Documents
Culture Documents
github.com/jay0lee/GAM
Cheat Sheet for GAM 4.40
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 Ve r s i o n 1 . 5 2 , 2 1 st M arc h, 2 0 1 8
Calendars Drive Management
gam calendar <calendar email> <action> [<options>] gam <who> show filelist [todrive] [query <query>]
where action and options are: [allfields] [createddate] [description] [fileextension]
[filesize] [id] [restricted] [starred] [trashed] [viewed]
showacl|wipe [lastmodifyingusername] [lastviewedbymedate]
add|update freebusy|read|editor|owner <user email>| [modifieddate] [originalfilename] [quotaused] [shared]
user <user email>|group <group email>| [writerscanshare]
domain [<Domain name>]|default gam <who> show driveactivity [todrive] [fileid <id>]
delete <user email>|user <user email>| [folderid <id>]
group <group email>|domain [<Domain name>]|default gam <who> show drivesettings [todrive]
addevent [attendee <user email>] [location <location>] gam <who> show fileinfo <id>|
[optionalattendee <user email>] [anyonecanaddself] [allfields|<DriveFieldName>*]
[summary <summary>] [source <title> <url>] gam <who> show filetree
[description <event description>] gam <who> show filerevisions <id>
[id <id>] [available] gam <who> add drivefile
start allday <YYYY-MM-DD>|<start datetime> [localfile <filepath>] [drivefilename <filename>]
end allday <YYYY-MM-DD>|<end datetime> [convert] [ocr] [ocrlanguage <language>]
[guestscantinviteothers] [guestscantseeothers] [restricted] [starred] [trashed] [viewed]
[visibility default|public|private] [tentative] [lastviewedbyme <date>] [modifieddate <date>]
[notifyattendees] [description <description> [mimetype <type>]
[noreminders]| [parentid <folder id>] [parentname <folder name>]
[reminder <minutes> email|popup|sms] [writerscantshare]
[recurrence <repeat>] [timezone <timezone] gam <who> update drivefile
[privateproperty <Key> <Value>] [localfile <filepath>] [newfilename <filename>]
[sharedproperty <Key> <Value>] [id <drive file id> | drivefilename <filename>]
[colorindex <Number from 1 to 11>] [convert] [ocr] [ocrlanguage <language>]
deleteevent [eventid <id>] [query <query>] [restricted true|false] [starred true|false]
[trashed true|false] [viewed true|false]
[notifyattendees] [doit]
[lastviewedbyme <date>] [modifieddate <date>]
[description <description>] [mimetype <type>]
gam <who> show calendars|calsettings [parentid <folder id>] [parentname <folder name>]
gam <who> delete calendar <calendar email> [writerscantshare]
gam <who> add | update calendar <calendar email> gam <who> get drivefile [id <file id> | query <query>]
[selected true|false] [hidden true|false] [format <openoffice|microsoft|pdf>]
[targetfolder <local path>] [revision <number>]
[reminder email|sms|popup (minutes)]
[summary <summary>] [colorindex (1-24)] gam <who> delete emptydrivefolders|
[backgroundcolor <htmlcolor> drivefile <file id> [purge]
[foregroundcolor <htmlcolor>] gam <who> transfer drive <target user> [keepuser]
gam <who> empty drivetrash
gam <who> update calattendees csv <csv file>
[start YYYY-MM-DD] [end YYYY-MM-DD] ACLs
[allevents] [dryrun] gam user <user email> show drivefileacl <file id> [asadmin]
gam <who> transfer seccals <target user> [keepuser] gam user <user email> add drivefileacl <file id>
[user|group|domain <value>|anyone] [withlink]
gam <who> info calendar <calendar email>|primary [role <reader|commenter|writer|owner>] [sendemail]
gam <who> print calendars [todrive] [emailmessage <message text>]
gam user <user email>update drivefileacl <file id>
<permission id> [withlink]
[role <reader|commenter|writer|owner>]
[transferownership <true|false>] [asadmin]
gam user <user email>delete drivefileacl <file id>
<permission id> [asadmin]
Team Drive
gam user <email> add teamdrive <name>
gam user <email> update teamdrive <id> [name <name>]
gam user <email> delete teamdrive <id>
gam user <email> print|show teamdrives
[todrive] [asadmin]
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 Ve r s i o n 1 . 5 2 , 2 1 st M arc h, 2 0 1 8
Groups Group Settings
gam create group <group email> <GroupAttributes> gam create | update group <group email>
gam update group <group email> <attributes/values>
[admincreated true|false] [email <EmailAddress>]
<GroupAttributes> where attributes and values are:
allow_external_members true|false
gam info group <group email> [nousers] [noaliases]
message_moderation_level moderate_all_messages|
[groups]
moderate_new_members|moderate_none|
gam update group <group email> moderate_non_members
add | update | sync primary_language <language>
owner|member|manager reply_to reply_to_custom|reply_to_ignore|
{user <email address> | reply_to_list|reply_to_managers|reply_to_owner|
group <group address> |org <org name> |
reply_to_sender
file <file name> | all users}
send_message_deny_notification true|false
gam update group <group email> clear show_in_group_directory true|false
[owner] [manager] [member] who_can_invite all_managers_can_invite|
gam update group <group email> all_members_can_invite
remove {user <email address> | who_can_join all_in_domain_can_join|
group <group address> | org <org name> | anyone_can_join|can_request_to_join|
file <file name> | all users} invited_can_join
gam delete group <group email> who_can_post_message all_in_domain_can_post|
gam <who> delete group all_managers_can_post|all_members_can_post|
anyone_can_post|none_can_post
gam print groups [domain <domain>] who_can_view_group all_in_domain_can_view|
[member <user email>] [maxresults <results>] all_managers_can_view|all_members_can_view|
[name] [description] [admincreated] [id] [aliases]
anyone_can_view
[members] [owners] [managers] [settings] [todrive]
who_can_view_membership all_in_domain_can_view|
[delimiter <delimchar>] [fields <list,of,fields>]
all_managers_can_view|all_members_can_view
gam print group-members [group <group email>] allow_google_communication true|false
[domain <domain>] [member <user email>] allow_web_posting true|false
[fields <list,of,fields>] [membernames] [todrive] archive_only true|false
custom_reply_to <email address>
is_archived true|false
max_message_bytes <integer>
members_can_post_as_the_group true|false
Calendar Resources message_display_font default_font|fixed_width_font
description <group description>
gam create resource <id> <Name> [parameters]
gam update resource <id> [name <Name>] [parameters] name <new name>
spam_moderation_level allow|moderate|
where parameters are:
[description <description>] [type <type>] silently_moderate|reject
[building <building>] [capacity <number>] include_in_global_address_list true|false
[features <features>] [floor <floor>] who_can_leave_group none_can_leave|
[floorsection <floorsection>] all_members_can_leave|all_managers_can_leave
who_can_contact_owner anyone_can_contact|
gam info|delete resource <id>
gam print resources [id] [description] [email] [type] all_in_domain_can_contact|
[allfields] [todrive] all_members_can_contact|all_managers_can_contact
gam create building <name> [id <id>] [latitude <latitude>]
[longitude <longitude>] [description <description>]
[floors <floors>]
gam update building <name or id:id> [name <name>]
[latitude <latitude>] [longitude <longitude>] Email Aliases
[description <description>] [floors <floors>] gam create|update alias <alias> user|group|target
gam info building <name or id:id> <primary address>
gam delete building <name or id:id> gam info alias <alias>
gam create feature name <name> gam delete alias [user|group|target] <alias>
gam update feature <name> name <newname>
gam <who> delete alias
gam delete feature <name>
gam print aliases [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 3 Ve r s i o n 1 . 5 2 , 2 1 st M arc h, 2 0 1 8
Classroom User Security Settings
gam <who>|file <filename> <command>
gam create course [id|alias <alias>] <CourseAttributes> where <command> is:
gam update course <CourseID>|alias <CourseAttributes> show tokens (oauth tokens)
show token clientid <client id>
where <CourseAttributes> is:
delete token clientid <client id>
[name <name>] [section <section>]
show asps (app-specific pwds)
[teacher <teacher email>]
delete asp <ID>
[heading <heading>] [description <description>]
show backupcodes (2-step verification)
[room <room>] [status <PROVISIONED|ACTIVE|
update backupcodes
ARCHIVED|DECLINED>]
delete backupcodes
gam info|delete course <CourseID> deprovision (remove tokens, asps,
gam course <CourseID> <command> and backupcodes)
where <command> is: gam print tokens [todrive] [clientid <ClientID>] <who>
add student|teacher <email address>
add|delete alias <alias> gam <who> show tokens
sync students|teachers group <group email> | S/MIME
ou <orgunit> | file <filename> | gam user <email> add smime <file <filename>>
query <users query> | course <id or alias> <password <password>> [default] [sendas <email>]
remove student|teacher <email address> gam user <email> update smime [id <id>]
gam print courses [teacher <email>] [student <email>] [sendas <email>] <default>
[state <states>] [todrive] [aliases] [delimiter <String>] gam user <email> delete smime <id <id>>
[sendas <email>]
gam print course-participants [course <id or alias>] gam user <email> show|print smime primaryonly todrive
[student <email>] [teacher <email>]
[show all|students|teachers] [todrive]
gam create|delete gaurdian <guardian email>
<student email>
gam show guardian [invitedguardian <guardian email>]
[student <StudentItem>] [invitations]
Reports
[states <GuardianStateList>] [<UserTypeEntity>] gam report users [todrive] [date <YYYY-MM-DD>]
gam print guardians [invitations] [student <email>] [user <user email>] [filter <filter terms>]
[invitedguardian <email>] [fields <included fields>]
[user <username>|group <email>| gam report admin|calendar|logins|tokens|drive|
ou <ouname>|all users] [nocsv] [todrive] groups|mobile [todrive] [user <user email>
[states <GuardianStateList>] [filter <filter terms>] [ip <ip address>]
where GuardianStateList is: [event <event name>]
[start <start datetime>] [end <end datetime>]
COMPLETE|PENDING|
GUARDIAN_INVITATION_STATE_UNSPECIFIED where the filter specifies the search terms1.
gam cancel guardianinvitation|guardianinvitations gam report domain [todrive] [date <YYYY-MM-DD>]
<GuardianInvitationID> <student email> [fields <included fields>]
<start datetime> and <end datetime> are in the format:
YYYY-MM-DDThh:mm:ss.000Z
1
https://developers.google.com/admin-sdk/reports/v1/reference/userUsageReport/get
Data Transfers
gam create datatransfer <old owner> drive|google+|
calendar <new owner> [parameter <value>]
Admin Roles
gam info datatransfer <id>
gam create admin <user> <role>
gam print datatransfers [oldowner <old owner>] <customer|org_unit <OU>>
[newowner <new owner>] [status completed|failed| gam delete admin <role assignment id>
inProgress|pending] [todrive] gam print admins [user <user>] [role <role>] [todrive]
gam print transferapps 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 4 Ve r s i o n 1 . 5 2 , 2 1 st M arc h, 2 0 1 8
Chrome Devices CloudPrint
gam update cros <device id> [user <user info>] gam printer register
[location <location info>] [notes <notes info>]
gam update printer <id> [quotaEnabled <true|false>]
[ou <new org unit>] [assetid <asset id>]
[dailyQuota <number>] [public <true|false>
[status active|deprovisioned|inactive|returnapproved|
[name <name>] [proxy <proxy>]
returnrequested|shipped|unknown]
[description <description>] [currentquota <Number>]
gam update cros <device id> [defaultdisplayname <String>] [displayname <String>]
action disable|reenable| [firmware <String>] [gcpversion <String>]
deprovision_same_model_replace| [istosaccepted <Boolean>] [manufacturer <String>]
deprovision_different_model_replace| [model <String>] [ownerid <EmailAddress>]
deprovision_retiring_device [status <Number>]|[type <String>]|[uuid <String>]|
[acknowledge_device_touch_requirement] [setupurl <URL>]|[supporturl <URL>]|
gam info cros <device id> [updateurl <URL>]
[allfields|full|basic] [nolists] [listlimit <Number>] gam info printer <id> [everything]
<CrOSFieldName>* [fields <CrOSFieldNameList>]
gam delete printer <id>
gam print cros [query <query>]
[orderby location|user|lastsync|serialnumber| gam print printers [query <query>] [type <type>]
supportenddate] [status <status>] [extrafields <connectionStatus|
[ascending|descending] [todrive] semanticState|uiState|queuedJobsCount>] [todrive]
[allfields|full|basic] [nolists] gam printer <id> <command>
[listlimit <Number>] [limit_to_ou <OU>]
<CrOSFieldName>* where <command> is:
[fields <CrOSFieldNameList>] add USER|MANAGER <group or user email>|
<domain>|public
gam print crosactivity [query <query>] [todrive] [times] remove <group or user email>|<domain>|public
[users] [start <yyyy-mm-dd>] [end <yyyy-mm-dd>] showacl
gam printjob <printer id> submit <file or url>
[title <string>] [tag <string>]
Mobile Devices gam printjob <id> cancel|delete
gam update mobile <mobile id> gam print printjobs [older_than <number><m|h|d>]
action wipe|approve|block| [newer_than <number><m|h|d>] [query <query>]
cancel_remote_wipe_then_activate| [status <status>] [printer <printer id>]
cancel_remote_wipe_then_block [owner <user email>] [limit <number>]
[model <String>] [os <String>] [useragent <String>] [orderby create_time|status|title]
[ascending|descending] [todrive]
gam info mobile <mobile id>
gam printjob <PrintJobID> resubmit <PrinterID>
gam print mobile [query <query>][basic|full]
[orderby deviceid|email|lastsync| gam printjob <PrinterID>|any fetch
model|name|os|status|type] [olderthan|newerthan <number><m|h|d>]
[ascending|descending] [todrive] [query <query>] [status done|error|held|in_progress|
queued|submitted] [orderby create_time|status|title]
gam delete mobile <mobile id> [ascending|descending] [owner <user email>]
[limit <number>]
Organizational Units
Licenses
gam create org <name> [description <Description>]
[parent <Parent Org>] [inherit|noinherit] gam <who> add|delete license <sku>
gam <who> update license <sku> [from] <oldsku>
gam update org <name> [name <Name>]
gam print licenses [products <product>] [sku <sku>]
[description <Description>] [parent <Parent>]
[todrive]
[inherit|noinherit]
gam update org <name> add|move users <Users>| where <sku> is:
file <File Name>|group <Group Name>| free|gafw|gafg|gams|gal|gau|gae|coordinate|vault|
all cros |cros <device id> vfe|coordinate|chrome|drive20gb|drive50gb|
drive200gb|drive400gb|drive1tb|drive2tb|drive4tb|
gam info org <name> [nousers|child]
drive8tb|drive16tb
gam delete org <name>
and <product> is
gam print orgs [todrive] [toplevelonly] Google-Apps|Google-Drive-storage|
[fromparent <name>] [allfields|<list of fields>] Google-Coordinate|Google-Vault
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 5 Ve r s i o n 1 . 5 2 , 2 1 st M arc h, 2 0 1 8
Domain Settings Vault
gam info instance gam create vaultmatter [name <name>]
gam info domain|domainalias <domain> [description <description>] [collaborators <emails>]
gam update vaultmatter <nameOrId> [name <name>]
gam create domain <domain> [description <description>]
gam create domainalias <domainalias> <parentdomain> [addcollaborators <emails>]
[removecollaborators <emails>]
gam delete domain|domainalias <domain> [action close|reopen|delete|undelete]
gam info vaultmatter <nameOrId>
gam print domains|domainaliases [todrive]
gam print vaultmatters [todrive] [basic]
gam update domain <domain> primary gam create vaulthold <matter nameOrId>
[name <name>] [corpus mail|drive|groups]
[query <query>] [accounts <emails>]
[orgunit <orgunit>]
Domain Verification [starttime YYYY-MM-DD] [endtime YYYY-MM-DD]
gam update hold <HoldNameOrId>
gam create verify <domain> <matter <MatterNameOrId>> [query <query>]
[orgunit <orgunit>] [addaccounts <emails>]
gam update verify <domain> <cname|txt|site|file> [removeaccounts <emails>]
[starttime YYYY-MM-DD] [endtime YYYY-MM-DD]
gam info verify gam info|delete vaulthold <HoldNameOrId>
matter <MatterNameOrId>
gam print vaultholds [matters <matters>] [todrive]
Admin Notifications
gam update notification id all|<notification ID> Customer
unread|read
gam info notification [unreadonly] gam info customer
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 6 Ve r s i o n 1 . 5 2 , 2 1 st M arc h, 2 0 1 8
Bulk Operations
gam csv <csv-filename> gam <regular command>
Parallel Commands
For both csv and batch commands, GAM will run
multiple actions in parallel. By default, GAM starts 5
worker threads and can run 5 commands at a time. You
can raise or lower this setting by setting an environment
variable called GAM_THREADS.
Definitions
<who> user <user email>|group <group email>|
ou <ouname>|all users
<datetime> RFC3339 formatted date and time,
e.g. YYYY-MM-DDThh:mm:ss.000Z
<user email> is a user in the domain
<group email> is a group in the domain
<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 7 Ve r s i o n 1 . 5 2 , 2 1 st M arc h, 2 0 1 8