This lesson is part of the "TAMING GAM - A practical guide to GAM and GAMADV-XTD3" course.
In this video, we will be walking through the set up of GAMADV-XTD3 on a Google Cloud Shell. You can either watch the video below, or follow the images and steps detailed below.
If you are trying to install GAM on another operating system, please refer to these articles:
Are you however trying to just upgrade your installation of GAM?
Let's get started.
If you would like to try it yourself, you can start here.
Firstly open Google Cloud Shell
Accept any permissions that are requested when you get to the URL.
Let's download the installation of GAMADV-XTD3 from the GitHub Releases page.
https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads
We need to install GAMADV-XTD3 in the terminal, so please run this command.
bash <(curl -s -S -L https://git.io/fhZWP) |
GAMADV-XTD3 is now installed on this shell. It then asks if you can run a full browser on this machine. You can't, so press N and enter.
The next question is whether you are ready to set up a Google API Project for GAM. We are going to press Y and enter.
Then enter your Google Workspace admin email.
You will see that files and folders have been created:
.gam and .gam/gamcache and Downloads
Also gam.cfg has been initialised.
However, there are a few files and folders missing. client_secrets.json oauth2.txt and oauth2service.json are not found.
Click or copy the URL that has been generated and paste it into a browser.
Sign in with an admin account and grant permissions.
Then copy the code and paste it into your terminal.
Once you run this, it starts enabling the APIs for your GAM Project.
The APIs have been enabled. Now click or copy the URL to create a Desktop App.
You need to create the Desktop App. You can name the OAuth 2.0 client whatever makes sense to you. I have named mine "GAM Cloud Shell" so it is easy for me to find later.
Once you click create, you will be presented with a Client ID and a Client Secret. These need to be pasted into the Cloud Shell in the respective positions.
The Project Creation is now complete. We now need to authorise GAM to perform Google Workspace management operations with the admin account. Press Y and enter.
You will now need to select the APIs that you want to enable. If you want all of them, just select S or, if you are happy with the scopes, then press C and enter.
You will now be presented with a very long URL. This URL can also be found in the path in your shell. Mine is under /home/michael/bin/gamadv-xtd3/gamoauthurls.txt. Depending on how you are working, it might be easier to copy and paste it from there. In Google Cloud Shell, it normally allows you to click on the URL.
If the URL worked, then you will be asked to login to your admin account to allow the API scopes.
Next you will be asked to copy and paste the code back into the terminal under the Verification Code.
That completes the Admin Authorisation. The oauth2.txt file has been created. You need to now authorise GAM to manage the Google Workspace user data and settings by pressing Y and enter. Then enter an email of a regular Workspace user, not the admin account.
The Domain-Wide Delegation for the admin user on the regular user, fails. This is an expected result. It is really just testing all the APIs. You will need to add the permissions to this in the next step.
Click on the link to open the browser and authorise the permissions.
We need to add a new client ID and click the authorise button. Then return to the terminal and reauthorise.
Below you will see the completed installation.
Now run this to test that you are connected to your domain.
gam info domain
Congratulations, you are ready to run GAMADV-XTD3! You might also want to check out how to install GAM on Ubuntu to see how to add aliases and paths.
There are some other commands that can be run.
gam config customer_id xxxx domain xxxx.com timezone local save verify
Well done on completing this quick lesson on how to get GAM set up for your domain on Google Cloud Shell.
Understanding the full capabilities of how to use GAM and GAMADV-XTD3 for your Google Workspace will increase your productivity and efficiency. Check out this full course of over 9 hours and 50 pages of free resources!