How to Install GAM7 on Windows, macOS and Linux
By Patronum
March 17, 2023
Read Time: 8 mins

By Patronum
March 17, 2023
Read Time: 8 mins

To install GAM7, run the .exe installer on Windows or the install script on macOS or Linux. Then run three setup commands, gam create project, gam oauth create and gam user you@yourdomain.com update serviceaccount, and approve domain-wide delegation in the Admin console. GAM7 is the current version of Google Apps Manager, the free, open-source command-line tool for Google Workspace admins. It replaced both legacy GAM and GAMADV-XTD3, and it’s maintained by community developers Jay Lee and Ross Scroggs, not by Google.
Version referenced in this guide: GAM 7.49.00 (released Oct 25, 2026). GAM releases often, so check before you start: the GitHub Releases page lists the newest build, and once GAM is installed, gam version checkrc prints your version next to the latest one.
On this page: Windows · macOS/Linux · Authorization · Upgrading · Troubleshooting
Check these four things first.
pip install gam7, you need Python 3.10 or later.Decide this before you run any GAM7 command, because the first initialization is where GAM7 picks up old credentials.
OLDGAMPATH before the first gam config drive_dir command so GAM7 copies your existing credentials. The upgrade section has the commands for each OS.Not sure which you have? Run gam version. If the output shows jay0lee@gmail.com, it’s legacy GAM. If it shows ross.scroggs@gmail.com, it’s GAMADV-XTD3. If it shows google-apps-manager@googlegroups.com, you already have GAM7.
Download the installer from the GitHub Releases page. For 7.49.00 the 64-bit file is gam-7.49.00-windows-x86_64.exe; ARM devices use windows-arm64.exe. Run it, and the README says you’ll be prompted to set up GAM.
The wiki’s Windows layout uses three folders: C:\GAM7 for the program, C:\GAMConfig for credentials and C:\GAMWork for output. In System > Advanced system settings > Environment Variables, add C:\GAM7 to the system Path and create a variable named GAMCFGDIR with the value C:\GAMConfig. Restart Command Prompt.
Upgrading from legacy GAM? Stop here and set OLDGAMPATH first (Windows steps). Otherwise, initialize GAM. This should be the first GAM7 command you run:
gam config drive_dir C:\GAMWork save verify
You should see a line ending in gam.cfg, Initialized. That means the install worked.
Open a terminal and run the install script from the GAM7 README:
bash <(curl -s -S -L https://gam-shortn.appspot.com/gam-install)
By default it creates a gam7 folder in $HOME/bin, downloads the right build, and starts setup. Add -d <Path> to install somewhere else. If it reports that Python isn’t installed, install Python from python.org, open a new terminal and run the command again.
The wiki then recommends keeping credentials and work files apart:
mkdir -p ~/GAMConfig, then add export GAMCFGDIR="$HOME/GAMConfig" to ~/.zshrc or ~/.bashrc and run source on that file.~/GAMWork, for the CSVs and reports you’ll produce.alias gam="$HOME/bin/gam7/gam", or a symlink in /usr/local/bin if you’ll call GAM from scripts (aliases don’t work inside scripts).Upgrading from legacy GAM? Set OLDGAMPATH now, before the next command (macOS/Linux steps). Otherwise, initialize GAM. This should be the first GAM7 command you run:
gam config drive_dir ~/GAMWork save verify
You should see Config File: .../GAMConfig/gam.cfg, Initialized. That means the install worked.
Authorization is three commands, run in order on any OS. Each one opens a browser window where you sign in as your super admin.
gam create project
Enter your super admin address when asked. GAM creates a project called “GAM Project”, turns on the APIs it needs (23 in the wiki’s example, from the Admin SDK to Vault), and creates a service account with a private key. It then sends you to the Google Cloud console to create an OAuth client: choose “Desktop App”, name it “GAM”, click Create, and paste the client ID and client secret back into the terminal.
On a headless server or Google Cloud Shell, run gam config no_browser true save first.
gam oauth create
GAM lists the API scopes it can request, with a default set already selected. Review them against the jobs you plan to run, press c to continue, approve in the browser, and GAM writes the credentials to oauth2.txt.
gam user admin@yourdomain.com update serviceaccount
Review the requested scopes against the tasks you intend to run, select the ones you need, and press c. Record who’s responsible for these credentials. On a new project, the delegation test shows every scope as FAIL. That’s expected. GAM prints a link that opens Security > Access and data control > API controls > Domain-wide delegation in the Admin console with the client ID and scopes filled in. Make sure “Overwrite existing client ID” is checked and click Authorize.
Know what you just granted: Google’s help page says that with domain-wide delegation, “the app has access to the data belonging to all of your users.” Store the GAM config folder like you’d store a super admin password.
Wait a few minutes, then check the service account:
gam user admin@yourdomain.com check serviceaccount
You’re done when it ends with All scopes PASSED!. If some scopes still fail, wait longer and run it again. The wiki says it can take several minutes, and Google says delegation changes can take up to 24 hours, though they’re usually much quicker.
Finally, save your customer ID and domain so GAM can skip extra API calls and you can type short usernames:
gam info domain
gam config customer_id C01234567 domain yourdomain.com timezone local save verify
Check what you have with gam version (see Fresh install or upgrade? for how to read it).
This is quick. GAM7 uses the same code base, the same gam.cfg and your existing project.
macOS/Linux: update in place:
bash <(curl -s -S -L https://gam-shortn.appspot.com/gam-install) -l -d ~/bin/gamadv-xtd3 -s -p false
Windows: run the GAM7 .exe installer and set the destination folder to your old C:\GAMADV-XTD3 folder.
On either OS, test with gam version and gam info domain.
You keep your project but add what GAM7 needs. The order matters: OLDGAMPATH has to be set before the first GAM7 initialization, because that’s the step that copies your old credential files.
gam config drive_dir command. On Windows, also remove the legacy GAM folder from the system Path.export OLDGAMPATH=~/bin/gam (adjust the path), then check with ls -l $OLDGAMPATH/*.json.set OLDGAMPATH=C:\GAM (adjust the path), then check with dir %OLDGAMPATH%\*.json. set only lasts for that window, so run the next steps in the same one.gam config drive_dir ~/GAMWork save verify (macOS/Linux) or gam config drive_dir C:\GAMWork save verify (Windows). It copies client_secrets.json, oauth2service.json and oauth2.txt into the new config folder. Check with ls -l $GAMCFGDIR or dir %GAMCFGDIR%, and copy any missing file across by hand.gam update project.oauth2.txt is in a different format, so delete it first: rm -f "$GAMCFGDIR/oauth2.txt" (macOS/Linux) or del %GAMCFGDIR%\oauth2.txt (Windows). Then run gam oauth create.gam user admin@yourdomain.com update serviceaccount, then gam user admin@yourdomain.com check serviceaccount, and finish with gam info domain and the gam config customer_id ... command from the test section.These are the errors the GAM7 wiki documents for setup, with its fixes.
| What you see | Likely cause | Fix |
|---|---|---|
| The user you specified is not authorized to create projects | Project creation is off for that admin, or they lack the Cloud role | Check the Google Cloud Platform service settings in the Admin console. If you use a Cloud organization, grant the admin the Project Creator role in IAM. |
“This app has been blocked on your domain” during gam create project | Third-party app access controls block GAM’s project-creation app | In Security > Access and data control > API controls, add the “GAM Project Creation” app and mark it Trusted. |
constraints/iam.disableServiceAccountKeyUpload violated | Your Cloud organization blocks service account key uploads. Google enforces this by default for organizations created on or after May 3, 2024; older organizations may have it on or off. | The wiki’s preferred fix is keyless: run GAM on Compute Engine or use Workload Identity Federation. Otherwise, an org policy admin turns the constraint off for the GAM project only, then you run gam upload sakey. |
The gam oauth create link returns a 400 or 404 error | The URL is too long because too many scopes are selected | Run it again and select fewer scopes. |
check serviceaccount shows FAIL for some scopes | Delegation not authorized yet, or still propagating | Open the link GAM prints, authorize with “Overwrite existing client ID” checked, wait, and retest. |
Start read-only. None of these change anything:
| Command | What it shows |
|---|---|
gam info user jane@yourdomain.com | One user’s full record |
gam print users fields primaryemail,orgunitpath,lastlogintime,suspended | Every user, as CSV |
gam print users issuspended disabledbefore -90d | Users suspended more than 90 days ago |
gam print groups members | Every group with its members |
gam print orgs | Your organizational unit tree |
gam user jane@yourdomain.com show filecounts | How many Drive files a user has |
Add todrive to any print command and GAM uploads the result to a Google Sheet in your admin’s Drive instead of printing it to the screen.
GAM7 is free and covers a huge share of the Google Workspace APIs, but somebody has to look after the scripts, the machine that runs them and the credentials. If most of what you’d script is joiners, leavers and signatures, Patronum is a Google Workspace management tool that does those jobs as policies you set up in a web dashboard: you pick all users, an organizational unit or a Google Group, then add actions such as group membership, calendar, Drive file and signature changes. Like GAM, it works through Google’s APIs using domain-wide delegation, and there’s a 30-day free trial with no credit card.
For a fuller picture, see our comparison of GAM alternatives for Google Workspace and Google Workspace automation compared, which puts GAM, Apps Script and no-code tools side by side.
gam version shows google-apps-manager@googlegroups.com, and gam version checkrc shows you’re on the latest releaseGAMCFGDIR points to a config folder that’s separate from your working folderOLDGAMPATH was set before the first gam config drive_dir and the old oauth2.txt was replacedgam create project finished and the OAuth client is a Desktop appgam oauth create wrote oauth2.txtgam user admin@yourdomain.com check serviceaccount ends in All scopes PASSED!gam info domain returns your customer ID, saved with gam config customer_id ... save-l (it leaves your project and authorizations alone), or run the newest .exe on Windows