Vous êtes sur la page 1sur 3

Dito GAM Cheat Sheet

github.com/jay0lee/GAM for GAM 3.65

Users User Email Calendars User Drive Management


gam create | update user <user email> [options] gam <who> <attributes/values> gam calendar <calendar email> showacl gam <who> show filelist [todrive] [query <query>]
gam <who> update user [options] gam calendar <calendar email> add | update [allfields] [createddate] [description] [fileextension]
where attributes and values are: freebusy|read|editor|owner <user email>| [filesize] [id] [restricted] [starred] [trashed] [viewed]
Common options: language <language code> [lastmodifyingusername] [lastviewedbymedate]
user <user email>|group <group email>|
[firstname <First Name>] [lastname <Last Name>] pagesize 25|50|100 domain [<Domain name>]|default [modifieddate] [originalfilename] [quotaused] [shared]
[password <Password>] [email <New Email>] shortcuts|arrows|snippets|utf|webclips|imap [writerscanshare]
[gal on|off] [admin on|off] [suspended on|off] gam calendar <calendar email> delete <user email>|
on|off
[sha] [md5] [crypt] [nohash] user <user email>|group <group email>| gam <who> show driveactivity [todrive] [fileid <id>]
signature <signature text> | file <signature file> domain [<Domain name>]|default
[changepassword on|off] [org <Org Name>] vacation on|off subject <subject text> [folderid <id>]
[message <message text>] gam calendar <user email> wipe
Extended options: gam <who> show drivesettings [todrive]
[relation <relation type> <relation value>] [file <message file>] gam <who> show calendars|calsettings
[externalid <id type> <id value>] startdate <YYYY-MM-DD> enddate <YYYY-MM-DD> gam <who> show fileinfo <id>|query <query>|
gam <who> delete calendar <calendar email>
[phone type <phone type> value <phone value> [contactsonly] [domainonly] drivefilename <DriveFileName>
label <label name> gam <who> add | update calendar <calendar email>
primary|notprimary] [selected true|false] [hidden true|false] gam <who> show filetree
[organization name <org name> title <org title> delete label <label name>
filter from <email address>|to <email address>| [reminder email|sms|popup (minutes)]
type <org type> department <org dept> gam <who> add drivefile [localfile <filepath>]
subject <words>| haswords <words>| [summary <summary>] [colorindex (1-24)]
symbol <org symbol> costcenter <org cost center> [drivefilename <filename>] [convert] [ocr]
[backgroundcolor <htmlcolor>
location <org location>description <org desc> nowords <words>| [ocrlanguage <language>] [restricted] [starred]
[foregroundcolor <htmlcolor>]
domain <org domain> primary|notprimary] musthaveattachment|label <label name>| [trashed] [viewed] [lastviewedbyme <date>]
markread|archive|star|forward <email address>| gam <who> update calattendees csv <csv file> [modifieddate <date>] [description <description>]
[address type <address type>
trash|neverspam [start YYYY-MM-DD] [end YYYY-MM-DD] [mimetype <type>] [parentid <folder id>]
unstructured <unstructered address>
sendas <email address> <name> [default] [allevents] [dryrun] [parentname <folder name>] [writerscantshare]
extendedaddress <address extended address>
streetaddress <address street address> [replyto <email address>] gam <who> transfer seccals <target user> [keepuser]
pop on|off [for allmail|newmail] [action keep| gam <who> update drivefile
locality <address locality> region <address region> gam calendar <calendar email> addevent [id <drive file id> | drivefilename <filename>]
postalcode <address postal code> archive|delete] [attendee <user email>] [location <location>]
forward on|off [email address] [keep|archive|delete] [localfile <filename>] [newfilename <filename>]
countrycode <address country code> [optionalattendee <user email>] [anyonecanaddself] [convert] [ocr] [ocrlanguage <language>]
pobox <address pobox> primary|notprimary] delegate to <user email> [summary <summary>] [source <title> <url>]
show delegates [csv] [restricted true|false] [starred true|false]
[im type <im type> protocol <im protocol> [description <event description>] [id <id>] [available]
delete delegate <user email> [trashed true|false] [viewed true|false]
primary <im value>] start allday <YYYY-MM-DD>|
profile shared|unshared [lastviewedbyme <date>] [modifieddate <date>]
[agreedtoterms on|off] <start datetime>
update photo <photo filename> end allday <YYYY-MM-DD>|
[description <description>] [mimetype <MIME type>]
[schemaname.fieldname <fieldvalue>] [parentid <folder id>] [parentname <folder name>]
[schemaname.multivaluefieldname multivalued get photo <end datetime>
delete photo [guestscantinviteothers] [guestscantseeothers] [writerscantshare]
<fieldvalue>]
show signature|vacation|sendas| [visibility default|public|private] gam <who> get drivefile [id <file id> | query <query>]
Extended options for update only: imap|pop| forward|profile [tentative] [notifyattendees]
[format <openoffice|microsoft|pdf>]
[customerid <string>] show gmailprofile [todrive] [noreminders]|[reminder <minutes> email|popup|sms]
[targetfolder <local path>]
[otheremail <type> <email address>] show labels [onlyuser] [recurrence <repeat>]
where type is: update label search <search> [timezone <timezone] gam <who> delete emptydrivefolders|
home|work|other|<custom> replace <replace> [merge] [privateproperty <Key> <Value>] drivefile <file id> [purge]
update labelsettings <label name> name [sharedproperty <Key> <Value>]
gam info user <user email> [nogroups] [noaliases] [colorindex <Number from 1 to 11>] gam <who> transfer drive <target user> [keepuser]
<new label name>
[nolicenses] [noschemas] [schemas list,of,schemas]
[message_list_visibility show|hide]
[userview] ACLs
[label_list_visibility show|hide|show_if_unread]
gam user <user email> show drivefileacl <file id>
gam delete user <user email>
gam undelete user <user email> [org <org Name>] gam user <who> delete|trash|untrash messages Calendar Resources gam user <user email> add drivefileacl <file id>
query <gmail search> [user|group|domain <value>|anyone] [withlink]
gam <who> print [doit] [maxto<action> <number>] gam create resource <id> <Name> [role <reader|commenter|writer|owner>] [sendemail]
gam print users [allfields] [custom all|list,of,schemas] gam user <who> modify messages [description <description>] [type <type>]
[emailmessage <message text>]
[userview] [ims] [emails] [externalids] [relations] addlabel|removelabel <label> gam update resource <id> [name <Name>]
[addresses] [organizations] [phones] [licenses] [photo] query <gmail search> [description <Description>] [type <Type>] gam user <user email>update drivefileacl <file id>
[firstname] [lastname] [emailparts] [deleted_only] [id] [doit] [maxto<action> <number>] <permission id> [withlink]
[orderby email|firstname|lastname] [query <query>] gam info resource <id> [role <reader|commenter|writer|owner>]
[ascending|descending] [domain <Domain Name>] where <action> is: gam delete resource <id> [transferownership <true|false>]
[fullname] [ou] [suspended] [changepassword] [gal] delete|trash|untrash|modify
[agreed2terms] [admin] [creationtime] [aliases] e.g. maxtotrash, maxtountrash gam print resources [id] [description] [email] [allfields] gam user <user email>delete drivefileacl <file id>
[lastlogintime] [groups] [ismailboxsetup] [todrive] [todrive] <permission id>

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.
http://goo.gl/1CRlcx Glen.Pringle@monash.edu 1 Vers ion 1 . 2 . 7 , 2 9 th Apr il, 2 0 1 6
Groups Group Settings Classroom Auditing Accounts
gam create group <group email> gam create | update group <group email> gam create course [alias <alias>] [name <name>] gam audit monitor create <source user email>
[name <Group Name>] <attributes/values> [section <section>] [heading <heading>] <destination user email>
[description <Group Description>]
[description <description>] [room <room>] [begin <begin date>] [end <end date>]
gam info group <group email> [nousers] where attributes and values are: [teacher <teacher email>] [status <PROVISIONED| [incoming_headers] [outgoing_headers]
allow_external_members true|false ACTIVE|ARCHIVED|DECLINED>] [nochats] [nodrafts] [chat_headers] [draft_headers]
gam update group <group email> message_moderation_level moderate_all_messages|
[name <Group Name>] gam audit monitor list <source user email>
moderate_new_members|moderate_none| gam update course <id or alias> [name <name>]
[description <Group Description>] gam audit monitor delete <source user email>
moderate_non_members [section <section>] [heading <heading>]
[email <new email address>] <destination user email>
primary_language <language> [description <description>] [room <room>]
gam update group <group email> reply_to reply_to_custom|reply_to_ignore| [status <PROVISIONED|ACTIVE| gam audit uploadkey
add | update | sync reply_to_list|reply_to_managers|reply_to_owner| ARCHIVED|DECLINED>] gam audit activity request <user email>
owner|member|manager reply_to_sender
{user <email address> | send_message_deny_notification true|false gam audit activity status [user email] [request_id]
group <group address> |org <org name> |
gam info course <id or alias>
show_in_group_directory true|false gam audit activity download | delete <user email>
file <file name> | all users} who_can_invite all_managers_can_invite| gam delete course <id or alias> <request_id>
gam update group <group email> all_members_can_invite
gam audit export request <user email>
remove {user <email address> | who_can_join all_in_domain_can_join| gam course <id or alias> <command> [begin <Begin Date>] [end <End Date>]
group <group address> | org <org name> | anyone_can_join|can_request_to_join|
[search <Search Query> [headersonly]
file <file name> | all users} invited_can_join where <command> is: [includedeleted]
who_can_post_message all_in_domain_can_post| add student|teacher <email address>
gam delete group <group email> gam audit export status [user email] [request_id]
all_managers_can_post|all_members_can_post| add|delete alias <alias>
gam <who> delete group
anyone_can_post|none_can_post sync students|teachers group <group email> | gam audit export download | delete
gam print groups [domain <domain>] who_can_view_group all_in_domain_can_view| ou <orgunit> | file <filename> | <user email> <request_id>
[member <user email>] all_managers_can_view|all_members_can_view| query <users query> | course <id or alias> gam audit export watch <user email> <request id>
[name] [description] [admincreated] [id] [aliases] anyone_can_view remove student|teacher <email address>
[members] [owners] [managers] [settings] [todrive] who_can_view_membership all_in_domain_can_view|
[delimiter <delimchar>] all_managers_can_view|all_members_can_view gam print courses [teacher <email>] User Security Settings
gam print group-members [group <group email>] allow_google_communication true|false [student <email>] [aliases] [todrive]
[todrive] allow_web_posting true|false gam <who>|file <filename> <command>
archive_only true|false gam print course-participants [course <id or alias>] where <command> is:
custom_reply_to <email address> [student <email>] [teacher <email>] [todrive] show tokens (oauth tokens)
is_archived true|false show token clientid <client id>
max_message_bytes <integer> delete token clientid <client id>
Custom User Schema members_can_post_as_the_group true|false show asps (app-specific pwds)
gam create | update schema <schemaname> message_display_font default_font|fixed_width_font Reports delete asp <ID>
description <group description> show backupcodes (2-step verification)
field <fieldname>
name <new name> gam report users [todrive] [date <YYYY-MM-DD>] update backupcodes
type <bool|double|email|int64|phone|string>
spam_moderation_level allow|moderate| [user <user email>] [filter <filter terms>] delete backupcodes
[indexed] [restricted] [multivalued]
silently_moderate|reject [fields <included fields>] deprovision (remove tokens, asps,
[range <min number> <max number>] endfield
include_in_global_address_list true|false and backupcodes)
gam print schemas gam report admin | logins | tokens | calendar | drive
who_can_leave_group all_members_can_leave| gam print tokens
[todrive] [user <user email> [filter <filter terms>]
gam info schema <schemaname> all_managers_can_leave gam <who> show tokens
[ip <ip address>] [start <start datetime>]
who_can_contact_owner anyone_can_contact|
gam delete schema <schemaname> [end <end datetime>] [event <event name>]
all_in_domain_can_contact|
all_members_can_contact|all_managers_can_contact where the filter specifies the search terms1.
Email Aliases
gam report domain [todrive] [date <YYYY-MM-DD>] gam create alias <alias> user|group|target
Definitions Admin Roles [fields <included fields>] <primary address>
<start datetime> and <end datetime> are in the format: gam update alias <alias> user|group|target
<who> user <user email>|group <group email>|
gam create admin <user> <role> YYYY-MM-DDThh:mm:ss.000Z <user email>
ou <ouname>|all users <customer|org_unit <OU>>
<datetime> RFC3339 formatted date and time, 1
gam info alias <alias>
https://developers.google.com/admin-sdk/reports/v1/reference/userUsageReport/get
e.g. YYYY-MM-DDThh:mm:ss.000Z gam delete admin <role assignment id> gam delete alias [user|group] <alias>
<user email> is a user in the domain gam <who> delete alias
gam print admins [user <user>] [role <role>] [todrive]
<group email> is a group in the domain
gam print aliases [todrive]
<email address> is any email address 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.
http://goo.gl/1CRlcx Glen.Pringle@monash.edu 2 Vers ion 1 . 2 . 7 , 2 9 th Apr il, 2 0 1 6
Chrome Devices CloudPrint Domain Settings Bulk Operations
gam update cros <device id> [user <user info>] gam info instance [logo <logo file>] gam csv <csv-filename> gam <regular command>
gam update printer <id> [quotaEnabled <true|false>]
[location <location info>] [notes <notes info>] Arguments starting with ~ will be substituted with the
[dailyQuota <number>] [public <true|false> gam info domain <domain>
[ou <new org unit>] [assetid <asset id>] [status active| value from the CSV row. For example:
[name <name>] [proxy <proxy>]
deprovisioned|inactive|returnapproved| gam info domainalias <domainalias>
[description <description>] [currentquota <Number>]
returnrequested|shipped|unknown] gam csv newusers.csv gam create user ~Email
[defaultdisplayname <String>] [displayname <String>]
gam update domain <domain> primary firstname ~Firstname lastname ~Lastname
gam info cros <device id> [firmware <String>] [gcpversion <String>]
password ~Password gal off changepassword off
gam print cros [query <query>] [orderby location| [istosaccepted <Boolean>] [manufacturer <String>]
[model <String>] [ownerid <EmailAddress>]
gam update instance <attributes/values> org Testing/Students
user|lastsync|serialnumber|supportenddate]
[ascending|descending] [basic|full] [status <Number>]|[type <String>]|[uuid <String>]| where attributes and values are: Note that the ~ (tilde) character may need to be escaped
[nolists|recentusers|timeranges] [setupurl <URL>]|[supporturl <URL>]| language <language> in some environments.
[orderby lastsync|location|notes|serialnumber| [updateurl <URL>] name <nice name>
Run multiple gam commands from batch file:
status|supportenddate|user] [todrive] gam info printer <id> [everything] admin_secondary_email <email address> gam batch <batch-filename>
gam delete printer <id> logo <logo file>
mx_verify When the command “commit-batch” is found, all
Mobile Devices gam print printers [query <query>] [type <type>] sso_settings enabled true| previous commands will be completed before
[status <status>] [extrafields <connectionStatus| false sign_on_uri <URI> sign_out_uri <URI> execution continues.
gam update mobile <mobile id> action wipe|approve |
semanticState|uiState|queuedJobsCount>] [todrive] password_uri <URI> whitelist <IP list>
block|cancel_remote_wipe_then_activate |
cancel_remote_wipe_then_block [model <String>] gam printer <id> <command> use_domain_specific_issuer true|false
[os <String>] [useragent <String>] where <command> is: sso_key <public key file>
gam info mobile <mobile id> add USER|MANAGER <group or user email>| user_migrations true|false Parallel Commands
<domain>|public outbound_gateway <SMTP Server Domain or IP>
For both csv and batch commands, GAM will run
gam print mobile [query <query>] remove <group or user email>|<domain>|public mode smtp|smtp_tls
multiple actions in parallel. By default, GAM starts 5
[orderby deviceid|email|lastsync|model|name|os showacl email_route destination <SMTP Server Domain or IP>
worker threads and can run 5 commands at a time. You
|status|type] [ascending|descending] [todrive] rewrite_to true|false enabled true|false can raise or lower this setting by setting an environment
gam printjob <printer id> submit <file or url>
[title <string>] [tag <string>]
bounce_notifications true|false variable called GAM_THREADS.
gam delete mobile <mobile id>
account_handling all_accounts|provisioned_accounts|
gam printjob <id> cancel|delete unknown_accounts Going much higher than 20 threads is not recommended

Organizational Units gam print printjobs [older_than <number><m|h|d>]


[newer_than <number><m|h|d>] [query <query>] gam create domain <domain>
or you’re likely to see issues with Google API quotas.

gam create org <name> [description <Description>] [status <status>] [printer <printer id>]
gam create domainalias <domainalias> <parentdomain>
[parent <Parent Org>] [noinherit] [owner <user email>]
[orderby create_time|status|title] gam delete domain <domain>
OAuth Key Management
gam update org <name> [name <New Name>] [ascending|descending] [todrive]
Set the variable OAUTHFILE in your shell to the file
[description <Description>] [parent <Parent>] gam printjob <PrintJobID> resubmit <PrinterID>
gam print domain [todrive]
containing the OAuth credentials and the variable
[inherit|noinherit] [add users <Users> | gam printjob <PrinterID>|any fetch OAUTHSERVICEFILE to the file containing the service
file <File Name> | group <Group Name>] account JSON key. The file must be in the same folder as
gam info org <name> [nousers|child]
[olderthan|newerthan <number><m|h|d>]
[query <query>] [status done|error|held|in_progress| Domain Verification gam.exe/gam.py or contain a path relative to this folder.
queued|submitted] [orderby create_time|status|title]
gam create verify <domain> gam oauth info [<access token>]
gam delete org <name> [ascending|descending] [owner <user email>]
gam update verify <domain> <CNAME|TXT|SITE> gam oauth create | revoke
gam print orgs [name] [description] [parent]
[inherit] [allfields] [toplevelonly] [todrive] Licenses gam info verify
gam <who> add|delete license <sku>
Various
Data Transfers gam <who> update license <sku> from <oldsku>
gam version

gam print licenses [products <product>] [sku <sku>] Customer gam whatis <user email>
gam create datatransfer <old owner> drive|google+ [todrive]
<new owner> [parameter <value>] gam info customer
where <sku> is:
gam info datatransfer <id> apps|gams|gau|coordinate|vault|vfe|coordinate| gam update customer [primary <DomainName>] Admin Notifications
drive20gb|drive50gb|drive200gb|drive400gb| [alternateemail <EmailAddress>]
gam print datatransfers [oldowner <old owner>] drive1tb|drive2tb|drive4tb|drive8tb|drive16tb [language <LanguageCode] [phone <String>] gam update notification id all|<notification ID>
[newowner <new owner>] [status completed|failed| [organizationname <String>] [contactname <String>] unread|read
inProgress|pending] [todrive] and <product> is [countrycode <String> [addressline1 <String>]
Google-Apps|Google-Drive-storage| gam info notification [unreadonly]
[addressline2 <String>] [addressline3 <String>]
gam print transferapps Google-Coordinate|Google-Vault [postalcode <String>] gam delete notification id all|<notification ID>

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.
http://goo.gl/1CRlcx Glen.Pringle@monash.edu 3 Vers ion 1 . 2 . 7 , 2 9 th Apr il, 2 0 1 6

Vous aimerez peut-être aussi