This lesson is part of the "TAMING GAM - A practical guide to GAM and GAMADV-XTD3" course.

Here we will walk you through the set up of GAMADV-XTD3 on a macOS Virtual Machine. This will also work on any version of macOS.

You can either follow along with the images and steps below, or watch the video.

If you are trying to install GAM on another operating system, please refer to these articles:

GAMADV-XTD3 on Windows

GAMADV-XTD3 on Ubuntu Linux

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.

Download And Install GAMADV-XTD3

Let's download the installation of GAMADV-XTD3 from the Downloads page.

At the time of recording this video, we installed GAMADV-XTD3 6.06.09.

Start a terminal session and execute this command, for a new installation in the default path $HOME/bin

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

Depending on how you have set up your macOS, you may be prompted to install the Command Line Tools.

Installing the Command Line tools for macOS

Once that has installed, which may take a couple of minutes, you will see this in your terminal.

bash <(curl -s -S -L https://git.io/fhZWP) Installation of GAMADV-XTD3 on macOS

Open a NEW terminal window.

We need to add a new line of code into the shell.

To get into your shell you will need to know what shell you are using. On a newish Mac, you are probably using ~/.zshrc. To see that this line was entered, we need to open a text editor. You can use whichever is on your machine, we are going to use Nano by running this command.

nano ~/.zshrc
Checking zshrc for the config line created by GAMADV-XTD3

As you can see, there is a line that was added by the installation. We need to add this line into the text editor. And then save the file. To save, use CTRL X and then press Y and then press enter.

export GAMCFGDIR="/Users/admin/GAMConfig"
Adding export GAMCFGDIR="/Users/admin/GAMConfig" to the zshrc shell

Now, let's create a GAMWork and GAMConfig directory in the macOS finder.

Create a GAMWork and GAMConfig directory in the macOS finder

We need to now move into the GAM folder. You will see that I started by running "ls". This will list the folders and files so that I can see where I am. Then I changed directory (cd see the red arrow) and moved myself into the bin/gamadv-xtd3 directory. I then ran "ls" again to see what was in that folder.

Moving into the GAMADV-XTD3 folder

Initialise GAMADV-XTD3

We then want to initialise GAMADV-XTD3 by running this command.

./gam config drive_dir /Users/admin/GAMWork verify

Verify the installation

ls -l ~/.gam

Now return to the first terminal window.

We can run a browser on this machine, so press Y

And then enter a Google Workspace email.

Setting up GAMADV-XTD3

Once you have added the admin email address, it will start running through the process of actually creating the Google App.

Create a GAM desktop App

Select the link provided and paste it into your browser. You will need to make a desktop app and name it something like GAM.

Then copy and paste your Client ID and Client Secret into the terminal.

Then copy and paste your Client ID and Client Secret into the terminal.

Now are you ready to authorise GAM to perform Google Workspace Management Operations? Just type Y

GAM API Scopes

Now choose the API you would like to authorise. You can select all scopes by using S, Unselect all using U, or press C to continue to Authorisation. If you would like to enable or disable API Scopes, you can just type the numbers that correspond to the various Scopes, and they will enable or disable.

If you would like to enable or disable API Scopes, you can just type the numbers that correspond to the various Scopes, and they will enable or disable.

When you press C you will be transferred to your Workspace and you will have to click allow authorising.

When you press C you will be transferred to your Workspace and you will have to click allow authorising.

Then back at the terminal, press Y to advise you are ready to authorise and then type in a regular Workspace user.

These will all fail the first time it runs.

API Scopes are all failing

Then copy and paste the long link from your terminal into your browser.

Copy the URL to authorise Google Workspace

Then we need to authorise the new Client ID.

Then we need to authorise the new Client ID.

Then go back to the terminal and try again by pressing Y and you will see the scopes all passing.

Then go back to the terminal and try again by pressing Y and you will see the scopes all passing.

Either copy and paste the command from your terminal to restart the terminal or just close and open it again. Then we are going to test that it works by running this command.

gam info domain

(Optional) Additional things you can run.

There are some other options that are suggested that you can run.

Additional Options

gam config customer_id xxxx domain xxxx.com timezone local save verify

What is next?

So that was a quick lesson on how to get GAM set up for your domain on macOS. If you would like more info on how to use GAM and GAMADV-XTD3 for your Google Workspace, check out this full online course of over 9 hours, including 50 pages of free resources, here.

This lesson is part of the "TAMING GAM - A practical guide to GAM and GAMADV-XTD3" course.

This lesson walks you through the set up of GAMADV-XTD3 on a Windows 10 Virtual Machine. You can also load it directly on your Windows 10 machine by following along with either the video below, or by following 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 Ubuntu Linux

GAMADV-XTD3 on Google Cloud Shell

GAMADV-XTD3 on macOS

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.

Download And Install GAMADV-XTD3

Let's download the installation of GAMADV-XTD3 from the GitHub Releases page.

At the time of recording this video, we installed GAMADV-XTD3 6.06.09.

Then run through the installation of your GAMADV-XTD3. Open the file you downloaded and click next all the way through. Make sure that you make a note of the path that you are installing in.

Installation of GAMADV-XTD3

Then make sure that it has installed into the correct path in your C Drive.

GAM Installation directory

Set a configuration directory

When you install GAM, the default GAM configuration directory is C:\Users.gam.

To make it easier to work with multiple companies, you may want to change it to a non user-specific location. This example assumes that the GAM configuration directory will be C:\GAMConfig; If you've chosen another directory, substitute that value in the directions.

Make the C:\GAMConfig directory before completing the rest of the steps.

Set a working directory

Another tip, to make your processing of commands easier, is to create a GAM working directory.

In this folder you will execute commands from this folder. You should not use C:\GAMADV-XTD3 or C:\GAMConfig for this purpose.

Make the C:\GAMWork directory before completing the rest of the steps.

Create GAMConfig and GAMWork

Set system path and GAM configuration directory

Start Control Panel

Open Control Panel

Click System

Open System in Control Panel

Click Advanced system settings

Click Advanced System Settings

Click Environment Variables

Click Environment Variables…


Click Path under System variables and Click Edit.

Click Path under System variables


If C:\GAMADV-XTD3 is already on the Path, skip the next three steps
Click New
Enter C:\GAMADV-XTD3

Click New
Enter C:\GAMADV-XTD3


Click OK
Click New
Set Variable name: GAMCFGDIR
Set Variable value: C:\GAMConfig
Click OK

Set Variable value: C:\GAMConfig
Click OK


Click OK
Click OK
Exit Control Panel

Initialise GAMADV-XTD3

Open the command prompt and run this command to get into the GAMADV-XTD3 directory.

cd C:\GAMADV-XTD3

Then run this command to initialize GAM

gam config drive_dir C:\GAMWork verify
gam config drive_dir C:\GAMWork verify

Verify initialisation

Once the previous command has run, run this command to verify that the GAM installation has initialised.

dir %GAMCFGDIR%
dir %GAMCFGDIR%

Start Creating your GAM Project

If you still have the command prompt open, then run the below command to create the GAM Project.

gam create project

Then add your Google Admin or GCP Project Manager account to the GAM command

Then, once it runs, copy the link from the command prompt and paste it into your browser.

Then, once it runs, copy the link from the command prompt and paste it into your browser.

Choose Desktop APP

Choose Desktop APP

Name your OAuth Client ID

Name your OAuth Client ID

Now that your OAuth Client has been created, copy your Client ID and Client Secret into the command prompt.

image 18

Now we need to create the OAuth connection.

gam oauth create
The APIs with the stars next to them are going to be enabled.

The APIs with the stars next to them are going to be enabled. Make a selection of what APIs you want and then click "c" to continue. And enter your admin email.

Press allow to enable the APIs

Press allow to enable the APIs

Enable GAMADV-XTD3 service account access.

We now need to test that it has worked for a specific user.

gam user user@domain.com check serviceaccount
gam user user@domain.com check serviceaccount

Copy the long URL for the authorisation and paste it into your browser.

 Copy the long URL for the authorisation and paste it into your browser.

Then click authorise.

Then click authorise.

Now to test

Run the same command as before to test that it is authorised.

gam user user@domain.com check serviceaccount
Run the same command as before to test that it is authorised.

Now run this to test that you are connected to your domain.

gam info domain
Now run this to test that you are connected to your domain.

Congratulations, you are ready to run GAMADV-XTD3!

(Optional) Additional things you can run.

There are some other that are suggested that you can run.

Additional Options

gam config customer_id xxxx domain xxxx.com timezone local save verify

What is next?

So that was an quick lesson on how to get GAM set up for your domain on Windows 10. If you would like more info on how to use GAM and GAMADV-XTD3 for your Google Workspace, please check out this full course of over 9 hours here.

taers232c/GAMADV-XTD3: Command line tool to manage ... - GitHub
GAMADV-XTD3 is a free, open source command line tool for Google Workspace (formerly G Suite) Administrators to manage domain and user settings quickly and ...

Taming Tech
Copyright © 2023 Outsource House [OSH.co.za] | All Rights Reserved Website development powered by Doiing.Digital | Training produced by Taming.Tech