...

Disabling Student Google Workspace Accounts in bulk

Nov 12, 2021

When your students graduate, you need to disable their accounts. Doing it one by one in the Google Workspace admin panel can be tedious. I created this BASH script that uses GAM to do all the work for me.

#!/bin/bash
# ------------------------------------------
INPUT=[filename of .csv containing student email addresses]
OLDIFS=$IFS
IFS=','
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
while read Email
do
/path/to/gam/gam update user $Email suspended on
done < $INPUT
IFS=$OLDIFS

< back