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!
This lesson is part of the "TAMING GAM - A practical guide to GAM and GAMADV-XTD3" course.
In this lesson, we will be walking you through the set-up of GAMADV-XTD3 on an Ubuntu Linux machine. 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:
GAMADV-XTD3 on Google Cloud Shell
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.
Let's start by opening a terminal on Ubuntu and running this command.
bash <(curl -s -S -L https://git.io/fhZWP)
Once that has run, you will see that it has added the GAM Alias to the profile file.
Before you continue, open a separate terminal window to make a couple of directories using the MKDIR command.
GAMConfig and GAMWork
Now we need to check that the alias for GAM is in our BASH Terminal using this command.
nano ~/.bashrc
This will open the nano editor. You can use whatever editor you are comfortable with.
You will see in the last line there, my alias is defined using my path. This will obviously change based on the user that you are logged into your machine as. Once you have confirmed the GAM alias, you can close the nano editor, using CTRL X.
Go back to the first terminal that you started in and answer the question on the screen. "Can you run a full browser on this machine?" And press the Y button and enter.
It should then say "GAM is now installed. Are you ready to set up a Google API project for GAM?" Just press Y again and enter.
Now type an admin email address that is present in Google Workspace.
Click allow on the screen that pops up in your browser to allow the GAM Project Creation to access the Google Account.
Back in the terminal, you will be asked to click on a URL. You can either right-click and copy it or directly click on it, depending on your Terminal Emulator and paste it in a browser.
In the browser that you have opened with the URL, select "Desktop app" and name the OAuth client ID that you are creating. I have simply called mine GAM Ubuntu or GAM Linux. Then click the create button.
Then copy the Client ID and Client Secret one at a time and paste it into the terminal in the respective places.
Now you need to press Y to "Authorize GAM to perform Google Workspace Management operations as your admin account".
Then you need to select the scopes that you would like GAM to be responsible for.
Each scope is represented by a number. You can either select all the scopes by pressing S, unselect all scopes by pressing U, or just continue by pressing C. If you need to select a scope that has a blank next to it, then type in the number that represents that scope. You can also, if it is supported, make it read-only by adding an R after the number.
Now authorise the script in the browser window that pops up.
GAMADV-XTD3 is now authorised. We now also need to authorise GAM to manage Google Workspace user data and settings. To authorise that, just press Y again.
Now you need to type the email address of a regular Google Workspace user.
This will fail the first time. This is almost a test step. You will be asked to copy a very long URL and paste it into your browser to make this happen.
Please select from the top of the red arrow to end of the URL, at the second red arrow. And paste that URL into your browser.
When you paste the URL into your browser you will come to this page. You just need to authorise by pressing the "Authorize" button.
You are now ready to retry the authorisation. Go back to your terminal and press Y. The scopes should all pass now.
You can either close your terminal and open it again, or run this command to get started right away.
alias gam="/home/paul/bin/gamadv-xtd3/gam"
Please make sure that you adapt it for your path.
Now run this to test that you are connected to your domain.
gam info domain
Congratulations, you are ready to run GAMADV-XTD3!
There are some additional options that you can 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 Ubuntu. If you would like to understand the full capabilities of how to use GAM and GAMADV-XTD3 for your Google Workspace, check out this full course of over 9 hours and 50 pages of free resources!