https://gamcheatsheet.com/ [email protected]
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.
© Copyright 2020 Glen Pringle Version 1.6.3, 20
th
August, 2020
1
User Email
gam <who> <attributes/values>
where attributes and values are:
language <language code>
show language
pagesize 25|50|100
shortcuts|arrows|snippets|utf|webclips on|off
signature <signature text> |(file <signature file>
[charset <Charset>]) (replace <Tag> <String>)*
[name <String>] [replyto <EmailAddress>]
vacation on|off [subject <String> (message
<String>)|(file <FileName> [charset <CharSet>])
(replace <Tag> <String>)* [html] [contactsonly]
[domainonly][startdate <Date>] [enddate <Date>]]
[add] label <label name> [messagelistvisibility
hide|show] [labellistvisibility
hide|show|showifunread] [backgroundcolor
<color>] [textcolor <color>]
delete label <label name>|regex:<RegularExpression>
|--ALL_LABELS--
update label search <search> replace <replace> [merge]
update labelsettings <label name> name <new label
name> [message_list_visibility show|hide]
[label_list_visibility show|hide|show_if_unread]
show labels [onlyuser]
filter from <email address>|to <email address>|subject
<words>| haswords <words>| nowords
<words>|musthaveattachment| label <label
name>|markread|archive|star| forward <email
address>|trash|neverspam
delete|info filter <FilterIDEntity>
[add]|update sendas <email address> <name>
[default] [replyto <email address>] [treatasalias
<Boolean>] [signature <String>|(file <FileName>
[charset <CharSet>]) (replace <RegularExpression>
<String>)*]
delete sendas <email address>
info sendas <email address] [format]
on|off [for allmail|newmail|fromnowown] [action
keep|leaveininbox|archive|delete|trash|markread]
imap on|off [noautoexpunge] [expungebehavior
archive|deleteforever|trash] [maxfoldersize
0|1000|2000|5000|10000]
on|off [email address] [keep|archive|delete]
delegate to <user email>
add delegate|forwardingaddress <user email>
show delegates [csv]
show vacation|filters|imap|pop|forward|profile|
forwardingaddress
show sendas|vacation|signature [format]
print [todrive]
delete delegate|forwardingaddress <user email>
profile shared|unshared
update photo <photo filename>
get photo [drivedir|(targetfolder <FilePath>)] [noshow]
delete photo
print filters|forward|sendas [todrive]
gam user <who> sendemail|draftemail [message
<message>] [file <file>] [subject <subject] [recipient
<recipient>]
gam user <who> insertemail|importemail [message
<message>] [file <file>] [subject <subject] [recipient
<recipient>] [labels <labels,>]
gam user <who> delete|trash|untrash
messages|threads query <gmail search> [doit]
[maxto<action> <number>]
gam user <who> modify messages
addlabel|removelabel <label> query <gmail search>
[doit] [maxto<action> <number>]
where <action> is:
delete|trash|untrash|modify
e.g. maxtotrash, maxtountrash
Drive Management
gam <who> show filelist [todrive] [query <query>]
[allfields] [createddate] [description] [fileextension]
[filesize] [id] [restricted] [starred] [trashed] [viewed]
[lastmodifyingusername] [lastviewedbymedate]
[modifieddate] [originalfilename] [quotaused]
[shared] [writerscanshare]
gam <who> show driveactivity [todrive] [fileid <id>]
[folderid <id>]
gam <who> show drivesettings [todrive]
gam <who> show fileinfo <id>|[allfields|
<DriveFieldName>*]
gam <who> show filetree
gam <who> show filerevisions <id>
gam <who> add drivefile [localfile <filepath>]
[drivefilename <filename>] [convert] [ocr]
[ocrlanguage <language>] [returnidonly]
[copyrequireswriterpermission true|false] [restricted]
[starred] [trashed] [viewed] [lastviewedbyme
<date>] [modifieddate <date>] [description
<description> [mimetype <type>] [parentid <folder
id>] [parentname <folder name>] [writerscantshare]
gam <who> update drivefile [localfile <filepath>]
[newfilename <filename>] [id <drive file id> |
drivefilename <filename>] [convert] [ocr]
[ocrlanguage <language>]
[copyrequireswriterpermission true|false] [restricted
true|false] [starred true|false] [trashed true|false]
[viewed true|false] [lastviewedbyme <date>]
[modifieddate <date>] [description <description>]
[mimetype <type>] [parentid <folder id>]
[parentname <folder name>] [writerscantshare]
gam <who> get drivefile [id <file id> | query <query>]
[format <openoffice|microsoft|pdf>] [targetfolder
<local path>] [revision <number>]
gam <who> delete emptydrivefolders| drivefile <file
id> [purge]
gam <who> transfer drive <target user> [keepuser]
gam <who> empty drivetrash
ACLs
gam user <user email> show drivefileacl <file id>
[asadmin]
gam user <user email> add drivefileacl <file id>
[user|group|domain <value>|anyone] [withlink]
[role <aclrole>] [sendemail] [emailmessage
<message text>]
gam user <user email>update drivefileacl <file id>
<permission id> [withlink] [role <aclrole>]
[transferownership <true|false>] [asadmin]
gam user <user email>delete drivefileacl <file id>
<permission id> [asadmin]
where <aclrole> is:
commenter|contentmanager|editor|fileorganizer|
organizer|owner|reader|writer
Team Drive
gam user <email> add teamdrive <name>
gam user <email> update teamdrive <id> asadmin
[name <name>]
gam user <email> delete teamdrive <id>
gam user <email> print|show teamdrives [todrive]
[asadmin]
Users
gam create|update user <user email> [options]
gam <who> update user [options]
Common options:
[firstname <First Name>] [lastname <Last Name>]
[password <Password>] [email <New Email>]
[gal on|off] [suspended on|off] [sha] [md5] [crypt]
[nohash] [changepassword on|off] [org <Org Name>]
Extended options:
[relation <relation type> <relation value>]
[externalid <id type> <id value>]
[phone type <phone type> value <phone value>
primary|notprimary]
[organization name <org name> title <org title>
type <org type> department <org dept>
symbol <org symbol> costcenter <org cost center>
location <org location>description <org desc>
domain <org domain> primary|notprimary]
[address type <address type>
unstructured <unstructered address>
extendedaddress <address extended address>
streetaddress <address street address>
locality <address locality> region <address region>
postalcode <address postal code> pobox <address
pobox> countrycode <address country code>
primary|notprimary]
[im type <im type> protocol <im protocol> primary
<im value>]
[location type <location type> area <area> building
<building> desk <desk> floor <floor> section
<section> endlocation]
[sshkeys expires <date> key <keyvalue>]
[posixaccounts gecos <gecos> gid <numeric gid>
uid <numeric uid> home <home path>
primary true|false shell <shell> system <systemid>
username <username> os <ostype> endposix]
[agreedtoterms on|off]
[schemaname.fieldname <fieldvalue>]
[schemaname.multivaluefieldname multivalued
<fieldvalue>]
[recoveryemail <email>] [recoveryphone <phone>]
Extended options for update only:
[customerid <string>]
[otheremail home|work|other|<custom> <email
address>]
gam info user <user email> [nogroups] [noaliases]
[nolicenses] [noschemas] [schemas list,of,schemas]
[userview] [skus <list,of,skus>]
gam delete user <user email>
gam undelete user <user email> [org <org Name>]
gam <who> print
gam print users [allfields] [custom all|list,of,schemas]
[userview] [ims] [emails] [externalids] [relations]
[addresses] [organizations] [phones] [licenses]
[photo] [firstname] [lastname] [emailparts]
[deleted_only] [id] [orderby
email|firstname|lastname] [query <query>]
[ascending|descending] [domain <Domain Name>]
[fullname] [ou] [suspended] [changepassword] [gal]
[agreed2terms] [admin] [creationtime] [aliases]
[lastlogintime] [groups] [ismailboxsetup] [todrive]
gam <who> show gmailprofile [todrive]
Calendars
gam calendar <cal email>|id:<cal id>
<action> [<options>]
where <action> and <options> are:
showacl|wipe
add|update freebusy|read|editor|owner <user
email>|user <user email>|group <group
email>|domain [<Domain name>]|default
delete <user email>|user <user email>|group <group
email>|domain [<Domain name>]|default
delete [user <user email>] [id <ACL id>]
addevent [attendee <user email>] [location <location>]
[optionalattendee <user email>] [anyonecanaddself]
[summary <summary>] [source <title> <url>]
[description <event description>] [id <id>]
[available] start allday <YYYY-MM-DD>|<start
datetime> end allday <YYYY-MM-DD>|<end
datetime> [guestscantinviteothers]
[guestscantseeothers] [hangoutsmeet] [visibility
default|public|private] [tentative] [notifyattendees]
[recurrence <repeat>] [noreminders]|[reminder
<minutes> email|popup|sms] [timezone <timezone]
[privateproperty <Key> <Value>] [sharedproperty
<Key> <Value>] [colorindex <index>]
updateevent eventid <id> <options> where <options>
are as p er add eve nt ab o ve
deleteevent [eventid <id>] [query <query>]
[notifyattendees] [doit]
gam <who> show calendars|calsettings
gam <who> delete calendar <calendar email>
gam <who> add | update calendar <calendar email>
[selected true|false] [hidden true|false] [reminder
email|sms|popup (minutes)] [summary <summary>]
[colorindex (1-24)] [backgroundcolor <htmlcolor>]
[foregroundcolor <htmlcolor>]
gam <who> update calattendees csv <csv file> [start
YYYY-MM-DD] [end YYYY-MM-DD] [allevents]
[dryrun]
gam <who> transfer seccals <target user> [keepuser]
gam <who> info calendar <calendar email>|primary
gam <who> print calendars [todrive]
Calendar Resources
gam create resource <id> <Name> [parameters]
gam update resource <id> [name <Name>]
[parameters]
where parameters are:
[description <description>] [type <type>] [building
<building>] [capacity <number>] [features
<features>] [floor <floor>] [floorsection
<floorsection>]
gam info|delete resource <id>
gam print resources [id] [description] [email] [type]
[allfields] [todrive]
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>]
[description <description>] [floors <floors>]
gam info building <name or id:id>
gam delete building <name or id:id>
gam create feature name <name>
gam update feature <name> name <newname>
gam delete feature <name>
GAM Cheat Sheet
github.com/jay0lee/GAM for GAM 5.11
https://gamcheatsheet.com/ [email protected]
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.
© Copyright 2020 Glen Pringle Version 1.6.3, 20
th
August, 20202
Groups
gam create | update group <group email>
<attributes/values>
where attributes and values are:
name <Group Name>
description <Group Description>
email <EmailAddress>
admincreated true|false]
allow_external_members true|false
message_moderation_level moderate_all_messages|
moderate_new_members|moderate_none|
moderate_non_members
primary_language <language>
reply_to
reply_to_custom|reply_to_ignore|reply_to_list|
reply_to_managers|reply_to_owner|reply_to_sender
send_message_deny_notification true|false
show_in_group_directory true|false
who_can_invite all_managers_can_invite|
all_members_can_invite
who_can_join
all_in_domain_can_join|anyone_can_join|
can_request_to_join|invited_can_join
who_can_post_message all_in_domain_can_post|
all_managers_can_post|all_members_can_post|
anyone_can_post|none_can_post
who_can_view_group all_in_domain_can_view|
all_managers_can_view|all_members_can_view|
anyone_can_view
who_can_view_membership all_in_domain_can_view|
all_managers_can_view|all_members_can_view
allow_google_communication true|false
allow_web_posting true|false
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
message_display_font default_font|fixed_width_fon t
spam_moderation_level allow|moderate|
silently_moderate|reject
include_in_global_address_list true|false
who_can_leave_group none_can_leave|
all_members_can_leave|all_managers_can_leave
who_can_contact_owner anyone_can_contact|
all_in_domain_can_contact|
all_members_can_contact| all_managers_can_contact
gam info group <group email> [nousers] [noaliases]
[groups]
gam update group <group email> add|update|sync
owner|member|manager
[allmail|nomail|daily|digest] [notsuspended] {user
<email address> | group <group address> |ou <org
name> | file <file name> | all users}
gam update group <group email> clear [owner]
[manager] [member]
gam update group <group email> remove {user <email
address> | group <group address> | org <org
name> | file <file name> | all users}
gam delete group <group email> gam <who> delete
group
gam print groups [domain <domain>] [member <user
email>] [maxresults <results>] [name] [description]
[admincreated] [id] [aliases] [members] [owners]
[managers] [settings] [todrive] [delimiter
<delimchar>] [fields <list,of,fields>]
gam print group-members [group <group email>]
[domain <domain>] [member <user email>] [fields
<list,of,fields>] [membernames] [todrive]
Email Aliases
gam create|update alias <alias> user|group|target
<primary address>
gam info alias <alias>
gam delete alias [user|group|target] <alias>
gam <who> delete alias
gam print aliases [todrive]
Reseller
gam create|update resoldcustomer <domain>
[alternateemail <email>] [phone <phone>] [address1
<address>] [address2 <address>] [address3
<address>] [contact <name>] [country <country>]
[city <city>] [organizationname <name>] [postalcode
<code>] [region <region>] [transfertoken <token>]
gam info resoldcustomer <domain>
gam create resoldsubscription <domain> [dealcode
<code>] [plan <plan>] [purchaseorderid <po>]
[seats <number> [max]] [sku <sku>] [transfertoken
<token]
gam update resoldsubscription <domain> <sku>
[activate] [suspend] [startpaidservice] [renewal
<renewaltype>] [seats <number> [max]] [plan
<plan> [seats <number> [max]] [purchaseorderid
<po>] [dealcode <code>]]
gam info resoldsubscriptions <domain> [transfertoken
<token>]
gam delete resoldsubscription <domain> <sku>
<deletiontype>
To p er fo rm ac tion s f or a resold cu s tom er set fol l owi ng
environment variable and then run gam as per normal.
export CUSTOMER_ID=<customer id>
Alerts
gam create alertfeedback <alertid> NOT_USEFUL|
SOMEWHAT_USEFUL|VERY_USEFUL|
ALERT_FEEDBACK_TYPE_UNSPECIFIED
gam print alert|alertfeedback
gam delete|undelete alert <alertid>
Admin Roles
gam create admin <user> <role> <customer|org_unit
<OU>>
gam delete admin <role assignment id>
gam print admins [user <user>] [role <role>] [todrive]
gam print roles [todrive]
Classroom
gam create course id [alias <alias>] <CourseAttributes>
gam update course <id or alias> <CourseAttributes>
where <CourseAttributes> is:
[name <name>] [section <section>]
[teacher <teacher email>]
[heading <heading>] [description <description>]
[room <room>] [status
<PROVISIONED|ACTIVE|ARCHIVED|DECLINED>]
gam info|delete course <id or alias>
gam course <id or alias> <command>
where <command> is:
add student|teacher <email address>
add|delete alias <alias>
sync students|teachers group <group email> |ou
<orgunit> | file <filename> |query <users query> |
course <id or alias>
remove student|teacher <email address>
gam print courses [teacher <email>] [student <email>]
[owneremail <email>] [state <states>] [todrive]
[aliases] [delimiter <String>]
gam print course-participants [course <id or alias>]
[student <email>] [teacher <email>] [show
all|students|teachers] [todrive]
gam create guardianinvite <guardian email> <student
email>
gam delete guardian <guardian email> <student email>
gam show guardian [invitedguardian <guardian email>]
[student <StudentItem>] [invitations] [states
<GuardianStateList>] [<UserTypeEntity>]
gam print guardians [invitations] [student <email>]
[invitedguardian <email>] [user <username>|group
<email>|ou <ouname>|all users] [nocsv] [todrive]
[states <GuardianStateList>]
where GuardianStateList is:
COMPLETE|PENDING|
GUARDIAN_INVITATION_STATE_UNSPECIFIED
gam cancel guardianinvitation|guardianinvitations
<GuardianInvitationID> <student email>
Reports
gam report users [todrive] [date <YYYY-MM-DD>]
[user <user email>] [filter <filter terms>] [fields
<included fields>]
gam report admin|calendar|logins|
tokens|drive|groups|mobile [todrive] [user <user
email> [filter <filter terms>] [ip <ip address>] [start
<start datetime>] [end <end datetime>] [event <event
name>]
where the filter specifies the search terms
1
.
gam report usage user|customer parameters <comma
separated parameters> [start_date <YYYY-MM-DD>]
[end_date <YYYY-MM-DD>] [orgunit <ou of users>]
[skip_dates <YYYY-MM-DD>...] [skip_days_of_week
mon,tue...] [todrive] [users|group|csvfile]
gam report domain [todrive] [date <YYYY-MM-DD>]
[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
User Security Settings
gam <who>|file <filename> <command>
where <command> is:
show tokens (oauth tokens)
show token clientid <client id>
delete token clientid <client id>
show asps (app-specific pwds)
delete asp <ID>
show backupcodes (2-step verification)
update backupcodes
delete backupcodes
deprovision (remove tokens, asps,
and backupcodes)
gam print tokens [todrive] [clientid <ClientID>] <who>
gam <who> show tokens
S/MIME
gam user <email> add smime <file <filename>>
<password <password>> [default] [sendas <email>]
gam user <email> update smime [id <id>]
[sendas <email>] <default>
gam user <email> delete smime <id <id>>
[sendas <email>]
gam user <email> show|print smime primaryonly
todrive
Various
gam version [simple|extended] [timeoffset]
[location] [check]
gam version|help
gam create|update project
gam whatis <user email>
Domain Verification
gam create verify <domain>
gam update verify <domain> <cname|txt|site|file>
gam info verify
Domain Settings
gam info instance
gam info domain|domainalias <domain>
gam create domain <domain>
gam create domainalias <domainalias>
<parentdomain>
gam delete domain|domainalias <domain>
gam print domains|domainaliases [todrive]
gam update domain <domain> primary
Data Transfers
gam create datatransfer <old owner> gdrive|calendar
<new owner> [parameter <value>]
gam info datatransfer <id>
gam print datatransfers [oldowner <old owner>]
[newowner <new owner>] [status completed|failed|
inProgress|pending] [todrive]
gam print transferapps
https://gamcheatsheet.com/ [email protected]
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.
© Copyright 2020 Glen Pringle Version 1.6.3, 20
th
August, 20203
Custom User Schema
gam create | update schema <schemaname> field
<fieldname> type
<bool|double|email|int64|phone|string> [indexed]
[restricted] [multivalued] [range <min number>
<max number>] endfield
gam print|show schemas
gam info schema <schemaname>
gam delete schema <schemaname>
Bulk Operations
gam csv|csvtest <csv-filename> gam <regular
command>
Arguments starting with ~ will be substituted with the
value from the CSV row. For example:
gam csv newusers.csv gam create user ~Email firstname
~Firstname lastname ~Lastname password
~Password gal off changepassword off org
Testing/Students
Note that the ~ (tilde) character may need to be escaped
in some environments.
Locally filter CSV output using the environment
variables GAM_CSV_HEADER_FILTER (comma-
separated list of column headers) and
GAM_CSV_ROW_FILTER (JSON string containing
column to filter on and value we want).
GAM_CSV_HEADER_DROP_FILTER removes listed
headers from results.
Run multiple gam commands from batch file:
gam batch <batch-filename>
When the command “commit-batch” is found, all
previous commands will be completed before execution
continues.
Chrome Devices
gam update cros <device id> [user <user info>]
[location <location info>] [notes <notes info>] [ou
<new org unit>] [assetid <asset id>] [status
active|deprovisioned|inactive|returnapproved|retur
nrequested|shipped|unknown]
gam update cros <device id> action
disable|reenable|deprovision_same_model_replace
|deprovision_different_model_replace|deprovision_r
etiring_device
[acknowledge_device_touch_requirement]
gam info cros <device id> [nolists] [listlimit <Number>]
[allfields|full|basic] [start <Date>] [end <Date>]
<CrOSFieldName>* [fields <CrOSFieldNameList>]
[downloadfile latest|<Time>] [targetfolder
<FilePath>]
gam print cros [query <query>|queries <query>+]
[orderby location|user|lastsync|serialnumber|
supportenddate [ascending|descending] ]
[basic|full|allfields] [start <Date>] [end <Date>]
[nolists|recentusers|timeranges|devicefiles]
[todrive] [listlimit <Number>] [limit_to_ou <OU>]
<CrOSFieldName>* [fields <CrOSFieldNameList>]
gam print crosactivity [query <query>|queries
<query>+] [todrive] [limittoou <OU>] [recentusers]
[timeranges] [both] [devicefiles] [all] [listlimit
<limit>] [delimiter <char>] [start <yyyy-mm-dd>]
[end <yyyy-mm-dd>]
Mobile Devices
gam update mobile <mobile id>|query:<query> action
wipe|approve|block|
cancel_remote_wipe_then_activate|
cancel_remote_wipe_then_block [model <String>]
[os <String>] [useragent <String>]
gam info mobile <mobile id>
gam print mobile [query <query>][basic|full] [orderby
deviceid|email|lastsync|
model|name|os|status|type]
[ascending|descending] [todrive]
gam delete mobile <mobile id>
CloudPrint
CloudPrint support has been dropped from GAM as of version 5.11
as CloudPrint is deprecated and won't be available after 2020.
gam printer register
gam update printer <id> [quotaEnabled <true|false>]
[dailyQuota <number>] [public <true|false> [name
<name>] [proxy <proxy>] [description
<description>] [currentquota <Number>]
[defaultdisplayname <String>] [displayname
<String>] [firmware <String>] [gcpversion <String>]
[istosaccepted <Boolean>] [manufacturer <String>]
[model <String>] [ownerid <EmailAddress>] [status
<Number>]|[type <String>]|[uuid <String>]|
[setupurl|supporturl|updateurl <URL>]*
gam info printer <id> [everything]
gam delete printer <id>
gam print printers [query <query>] [type <type>]
[status <status>] [extrafields <connectionStatus|
semanticState|uiState|queuedJobsCount>] [todrive]
gam printer <id> <command>
where <command> is:
add user|manager|owner <group or user email>|
[domain:]<DomainName>|public
remove <group or user email>|<domain>|public
showacl
gam printjob <printer id> submit <file or url> [title
<string>] [tag <string>]
gam printjob <id> cancel|delete
gam printjob <PrintJobID> resubmit <PrinterID>
gam printjob <PrinterID>|any fetch [olderthan|
newerthan <number><m|h|d>] [query <query>]
[status done|error|in_progress|queued|submitted|
held] [orderby create_time|status|title] [owner <user
email>] [limit <number>] [ascending|descending]
gam print printjobs [older_than <number><m|h|d>]
[newer_than <number><m|h|d>] [query <query>]
[status <status>] [printer <printer id>] [owner <user
email>] [limit <number>] [orderby create_time|
status|title] [ascending|descending] [todrive]
Licenses
gam <who> add|delete license <sku>
gam <who> update license <sku> [from] <oldsku>
gam print licenses [todrive] [products <product>]|[sku
<sku>]|allskus|gsuite] [countsonly]
where <sku> is:
free|gafw|gafg|gams|gal|gau|gae|e4e|coordinate|
vault|vfe|identity|identitypremium|coordinate|20gb
|50gb|200gb|400gb|1tb|2tb|4tb|8tb|16tb|chrome
and <product> is:
Google-Apps|Google-Drive-storage|Google-Vault|
Google-Coordinate|Google-Chrome-Device-
Management
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.
Going much higher than 20 threads is not recommended
or yo u ’re likel y to see issu es wit h Goo gl e API qu otas .
Organizational Units
gam create org <name> [description <Description>]
[parent <Parent Org>] [inherit|noinherit]
gam update org <name> [name <Name>] [description
<Description>] [parent <Parent>] [inherit|noinherit]
gam update org <name> add|move users <Users>|
file <File Name>|group <Group Name>|all cros
|cros <device id>
gam info org <name> [nousers|child]
gam delete org <name>
gam print orgs [todrive] [toplevelonly] [fromparent
<name>] [allfields|<list of fields>]
Vault
gam create vaultmatter [name <name>] [description
<description>] [collaborators <emails>]
gam update vaultmatter <nameOrId> [name <name>]
[description <description>] [addcollaborators
<emails>] [removecollaborators <emails>] [action
close|reopen|delete|undelete] gam info vaultmatter
<nameOrId>
gam print vaultmatters [todrive] [basic] gam create
vaulthold <matter nameOrId> [name <name>]
[corpus mail|drive|groups] [query <query>]
[accounts <emails>] [orgunit <orgunit>] [starttime
YYYY-MM-DD] [endtime YYYY-MM-DD]
gam update hold <HoldNameOrId> <matter
<MatterNameOrId>> [query <query>] [orgunit
<orgunit>] [addaccounts <emails>] [removeaccounts
<emails>] [starttime YYYY-MM-DD] [endtime YYYY-
MM-DD]
gam info|delete vaulthold <HoldNameOrId> matter
<MatterNameOrId>
gam print vaultholds [matters <matters>] [todrive] gam
create export [matter <matter>] [name <name>]
[corpus <drive|mail|groups|hangouts_chat>] [scope
<all_data|held_data|unprocessed_data>] [accounts
<emails> | orgunit <orgunit>|teamdrives
<teamdrives> | rooms <rooms> | everyone] [terms
<terms>] [start <date>] [end <date>] [timezone
<timezone>] [format mbox|pst] [excludedrafts
true|false] [driveversiondate <date>]
[includeteamdrives] [includerooms]
[includeaccessinfo true|false]
gam info|download export <matter> <export>
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
OAuth Key Management
Set the variable OAUTHFILE in your shell to the file
containing the OAuth credentials and the variable
OAUTHSERVICEFILE to the file containing the service
account JSON key. The file must be in the same folder as
gam.exe/gam.py or contain a path relative to this folder.
gam oauth info [<access token>]
gam oauth create [<EmailAddress>]
gam oauth create [admin <EmailAddress>]
[scope|scopes <APIScopeURLList>]
gam oauth revoke
gam show sakey [all|system|user]
gam rotate sakey [local_key_size <1024|2048|4096>]
[retain_none|retain_existing|replace_current]
[algorithm KEY_ALG_RSA_1024|
KEY_ALG_RSA_2048]
gam delete sakeys <key_ids> [doit]
Customer
gam info customer
gam update customer [alternateemail <EmailAddress>]
[language <LanguageCode] [phone <String>]
[organizationname <String>] [contactname <String>]
[countrycode <String> [addressline1 <String>]
[addressline2 <String>] [addressline3 <String>]
[locality <String>] [region <String>] [postalcode
<String>] [countrycode <String>]
https://gamcheatsheet.com/ [email protected]
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.
© Copyright 2020 Glen Pringle Version 1.6.3, 20
th
August, 2020
4
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