You are on page 1of 7

GAM

github.com/jay0lee/GAM
Cheat Sheet for GAM 4.40

Users User Email


gam <who> <attributes/values>
gam create | update user <user email> [options]
gam <who> update user [options] where attributes and values are:
language <language code>
Common options: pagesize 25|50|100
[firstname <First Name>] [lastname <Last Name>] shortcuts|arrows|snippets|utf|webclips on|off
[password <Password>] [email <New Email>] signature <signature text> |(file <signature file>
[gal on|off] [admin on|off] [suspended on|off] [charset <Charset>]) (replace <Tag> <String>)*
[sha] [md5] [crypt] [nohash] [name <String>] [replyto <EmailAddress>]
[changepassword on|off] [org <Org Name>] vacation on|off [subject <String> (message <String>)|
Extended options: (file <FileName> [charset <CharSet>]) (replace <Tag>
[relation <relation type> <relation value>] <String>)* [html] [contactsonly] [domainonly]
[externalid <id type> <id value>] [startdate <Date>] [enddate <Date>]]
[phone type <phone type> value <phone value> [add] label <label name> [messagelistvisibility hide|show]
primary|notprimary] [labellistvisibility hide|show|showifunread]
[organization name <org name> title <org title> delete label <label name> |regex:<RegularExpression>|
type <org type> department <org dept> --ALL_LABELS--
symbol <org symbol> costcenter <org cost center> update label search <search> replace <replace> [merge]
location <org location>description <org desc> update labelsettings <label name> name <new label name>
domain <org domain> primary|notprimary] [message_list_visibility show|hide]
[address type <address type> [label_list_visibility show|hide|show_if_unread]
unstructured <unstructered address> show labels [onlyuser]
extendedaddress <address extended address> filter from <email address>|to <email address>|
streetaddress <address street address> subject <words>| haswords <words>|
locality <address locality> region <address region> nowords <words>|musthaveattachment|
postalcode <address postal code> pobox <address pobox> label <label name>|markread|archive|star|
countrycode <address country code> primary|notprimary] forward <email address>|trash|neverspam
[im type <im type> protocol <im protocol> delete|info filter <FilterIDEntity>
primary <im value>] [add]|update sendas <email address> <name> [default]
[location type <location type> area <area> [replyto <email address>] [treatasalias <Boolean>]
building <building> desk <desk> floor <floor> [signature <String>|(file <FileName> [charset <CharSet>])
section <section> endlocation] (replace <RegularExpression> <String>)*]
[sshkeys expires <date> key <keyvalue>] delete sendas <email address>
[posixaccounts gecos <gecos> gid <numeric gid> info sendas <email address] [format]
uid <numeric uid> home <home path> pop on|off [for allmail|newmail|fromnowown] [action
primary true|false shell <shell> system <systemid> keep|leaveininbox|archive|delete|trash|markread]
username <username> endposix] imap on|off [noautoexpunge]
[agreedtoterms on|off] [expungebehavior archive|deleteforever|trash]
[schemaname.fieldname <fieldvalue>] [maxfoldersize 0|1000|2000|5000|10000]
[schemaname.multivaluefieldname multivalued forward on|off [email address] [keep|archive|delete]
<fieldvalue>] delegate to <user email>
add delegate|forwardingaddress <user email>
Extended options for update only: show delegates [csv]
[customerid <string>] show forwardingaddress
[otheremail home|work|other|<custom> <email address>] show vacation|filters|imap|pop| forward|profile
gam info user <user email> [nogroups] [noaliases] show sendas|vacation|signature [format]
[nolicenses] [noschemas] [schemas list,of,schemas] print delegates|forwardingaddress [todrive]
[userview] [skus <list,of,skus>] delete delegate|forwardingaddress <user email>
profile shared|unshared
gam delete user <user email> update photo <photo filename>
gam undelete user <user email> [org <org Name>] get photo [drivedir|(targetfolder <FilePath>)] [noshow]
gam <who> print delete photo
gam print users [allfields] [custom all|list,of,schemas] print filters|forward|sendas [todrive]
[userview] [ims] [emails] [externalids] [relations] gam user <who> delete|trash|untrash messages|threads
[addresses] [organizations] [phones] [licenses] [photo] query <gmail search> [doit] [maxto<action> <number>]
[firstname] [lastname] [emailparts] [deleted_only] [id] gam user <who> modify messages
[orderby email|firstname|lastname] [query <query>] addlabel|removelabel <label> query <gmail search>
[ascending|descending] [domain <Domain Name>] [doit] [maxto<action> <number>]
[fullname] [ou] [suspended] [changepassword] [gal]
[agreed2terms] [admin] [creationtime] [aliases] where <action> is:
[lastlogintime] [groups] [ismailboxsetup] [todrive] delete|trash|untrash|modify
e.g. maxtotrash, maxtountrash
gam <who> show gmailprofile|gplusprofile [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 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

gam delete notification id all|<notification ID> gam update customer


[alternateemail <EmailAddress>]
[language <LanguageCode] [phone <String>]
[organizationname <String>] [contactname <String>]
Reseller [countrycode <String> [addressline1 <String>]
[addressline2 <String>] [addressline3 <String>]
gam create|update resoldcustomer <domain> [postalcode <String>]
[alternateemail <email>] [phone <phone>]
[address1 <address>] [address2 <address>]
[address3 <address>] [contact <name>]
[country <country>] [city <city>]
Custom User Schema
[organizationname <name>] [postalcode <code>] gam create | update schema <schemaname>
[region <region>] [transfertoken <token>] field <fieldname>
gam info resoldcustomer <domain> type <bool|double|email|int64|phone|string>
gam create resoldsubscription <domain> [indexed] [restricted] [multivalued]
[dealcode <code>] [plan <plan>] [purchaseorderid <po>] [range <min number> <max number>] endfield
[seats <number> [max]] [sku <sku>]
[transfertoken <token] gam print schemas
gam update resoldsubscription <domain> <sku> [activate] gam info schema <schemaname>
[suspend] [startpaidservice] [renewal <renewaltype>]
[seats <number> [max]] [plan <plan> gam delete schema <schemaname>
[seats <number> [max]] [purchaseorderid <po>]
[dealcode <code>]]
gam info resoldsubscriptions <domain>
[transfertoken <token>] Various
gam delete resoldsubscription <domain> <sku> gam version [simple] [check]
<deletiontype>
gam version|help
export CUSTOMER_ID=<customer id>
gam user <email> check serviceaccount gam create project
gam user <email> add drivefile localfile <filepath>
gam whatis <user email>

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>

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.

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.

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 you’re likely to see issues with Google API quotas.

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 | revoke

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

You might also like