A step-by-step implementation guide

In order to follow along with this section, it is required that you download the .zip file from GitHub with the extended GAM scripts. The link can be found here: https://github.com/taers232c/GAM-Scripts

Once downloaded, you can try entering the following scripts into your GAM command-line tool.

Note:

All scripts will be written with quotation marks to indicate the length and spaces in between the characters. When executing the script, you need to remove the quotation marks i.e. “filelistperms.csv” →  filelistperms.csv


1. Find all groups without members

This script lists all Groups in Google Workspace including the number of members, managers, and owners. It then returns all empty groups.

Open GAM

Step 1: Enter “gam print groups memberscount managerscount ownerscount > GroupCounts.csv”

Step 2: Press Enter

Step 3: Wait for the script to be done

Step 4: Enter “python GetEmptyGroups.py GroupCounts.csv EmptyGroups.csv”

Step 5: Press Enter

Step 6: View the results in the “EmptyGroups.csv” file

2. How many Google Drive files has your organization shared?

This script lists all files in the users’ “My Drive” including the ACL (Access Control Lists). It then sorts this information and displays all the shared files by file-owner, file-id, file-name, file-permissions, and many other parameters.

Open GAM

Step 1: Enter “gam all users print filelist id title permissions > filelistperms.csv“

Step 2: Press Enter

Step 3: Wait for the script to be done

Step 4: Enter “python GetSharedFiles.py filelistperms.csv sharedfiles.csv”

Step 5: Press Enter

Step 6: View the result in the file  “sharedfiles.csv”

3. Who has delegated access to mailboxes?

A delegated access allows someone else to manage another person’s Google Workspace account/apps e.g. Gmail.  This script lists all people who have delegated access to all mailboxes in your organization and then sorts them accordingly to every mailbox that each user has access to.

Open GAM

Step 1: Enter “gam all users print delegates shownames > AllDelegates.csv“

Step 2: Press Enter

Step 3: Wait for the script to be done

Step 4: Enter “python ShowDelegators.py AllDelegates.csv AllDelegators.csv”

Step 5: Press Enter

Step 6: View the result in the file “AllDelegators.csv”

Want to learn more about GAM and how to use it in your daily work? Download our free ebook here: