GAMADV-XTD3 Commands

General Information

This is a collection of GAM commands I use or have kept, waiting for the time they "save the day".

I am running GAMADV-XTD3 in the cloud. But use commands from both GAM & GAMADV-XTD3 as needed, although I am not always sure which is which.  Some commands are taken from the Google Group and the Google Chat Space, some I have managed to work out myself. 

Please note

GAMADV-XTD3 commands may not work in a GAM enviroment. But I am sure GAM commands will work in a GAMADV-XTD3 enviroment.

GAMADV-XTD3 has additional functionality over standard GAM.

Where possible I have tested all of these commands, however I take no responsibility for their use. Always test commands before running them in a production environment.

Update

Update Cloud GAMADV-XTD3

Run this command to update a Cloud install of GAMADV-XTD3

bash <(curl -s -S -L https://git.io/fhZWP) -l

Aliases

The .bashrc or the .profile files may include an Alias entry. This needs to point to the correct version of GAM.

alias gam="/home/your_folder_path/bin/gamadv-xtd3/gam"

Check the version of GAM

gam version

This command will check and display the Current & Latest version.

gam version checkrc

Check if last command ran OK

echo $?

If return is 0 then there were no errors for the last run command. Useful if you run GAM in the cloud and the connection gets reset.

Configuring gam.cfg file

View the config file

gam config verify

Prevent/Allow the file to open in the browser and/or send an email confirmation.

gam select default config todrive_nobrowser <Boolean> todrive_noemail <Boolean> save verify

Service Account

Ensure GAM is authorised to access your Google Domain info.

gam user <Any Domain Email Address> check serviceaccount

They should all PASS, if not follow the directions onscreen. See this page for more info https://admin.google.com/ManageOauthClients. It can take a short while for all to PASS. You may need to run the above command a few times to check.

Installation on Cloud Shell

GAM installed on another computer?

If so, then you should copy client_secrets.json, oauth2.txt and oauth2service.json from that computer

to /home/user_name/.gam in CloudShell.

First installation of GAM

On any computer in your domain, then do the following:-

gam create project

gam oauth create

gam user someuser@domain.com check serviceaccount

Installation Guide

Not followed through as I has already set up in the Cloud Shell, but looks comprehensive.

https://basuta.com/  - Install GAM in Cloud Shell 

Access Denied

If you get the Access Denied error message, try;-

gam oauth refresh

gam oauth update

gam user user@example.com check serviceaccount

gam info domain