For admin of Google Workspace accounts. This free Add-on by {CLAYCODES} allows you to create a list of users and bulk suspend user accounts. Clay Smith is a Google Certified Innovator, his Add-ons are huge time savers for administrators and teachers. I personally know Clay and can vouch that his Add-ons and extensions are safe and compliant.
Be sure to check out Clay’s other Add-ons.
Bounded Scripts – Bulk Suspend
There are 2 ways to distribute Google Apps Script Add-ons. I personally have coded hundreds of Add-ons but only have 19 of them officially published by Google. The unofficial ones you distribute as a bounded script. This essentially means that the code is “STAPLED” to the Google Apps document. You do not have to look at the code, but you do have to have a copy of the bounded script. You can NOT access bounded scripts in the Google Marketplace. Instead, you make a copy of the, in this case, Google Sheets spreadsheet.
Since you are copying the doc, you are the owner of the code (although it is still under copyright!) and thus will need to authorize YOURSELF access to the code. You absolutely should be cautious about getting bounded scripts and authorizing them without knowing who they are from. This bounded script is safe. You can trust if myself or people who I have vetted (ClayCodes) created it it is safe. However, you have the ability to review the code yourself by going to the Extensions menu to verify that indeed there is no malicious code before you authorize it.
Get the Bounded Bulk Suspect Script
This is Nerdy
If you are wanting to bulk suspend Google Workspace users you have access to the Admin panel at the school and are responsible for managing the Google accounts of teachers, students, and staff. Thus, you have a significant level of techie prowessness. You will need to access the code and set some things up before it works.
Advanced Google Services
After making a copy of the spreadsheet use the Extensions menu at the top and select “Apps Script.”
Turn on Admin Directory API
This is essential, if you do not enable the Admin Directory API for this bounded script it will not work. You are ONLY enabling for this copy of the spreadsheet, not for all spreadsheets. Here is documentation for the Admin Directory.
You will notice the AdminDirectory is already added as a service. HOWEVER, you must still manage the API in Google Cloud.
Settings
Click on the settings cog on the left rail. Under “Google Cloud Platform (GCP) Project” click on “Change project.
GCP
To get the project ID you will need to create a project in Google Cloud. Select “New project” and name your project. From the cloud dashboard you can get the project id.
Admin SDK
For this project you just created in GCP, you will need to use the search box at the top to locate “Admin SDK.” Be sure that the top left shows this current project as the one you’re authorizing it for.
Enter YOUR DOMAIN
The code needs to specifically mention your domain. Line 34 of the code says ‘<DOMAIN HERE>’ Be sure to put your district domain between the quotes, but without the < >. For example: ‘mydomain.com’
Back to the Spreadsheet
Now that you have personalized the code and set up your GCP project, you can utilize the menu in the spreadsheet.
Import Accounts
Select “Import Accounts” from the menu.
Checkoff
There is a checkbox created next to each account name. Checkbox the accounts you wish to suspend.
Suspend Multiple Accounts
Use the menu option to “Suspend Multiple Accounts.”
- Table of Contents for your Google Collections
- Bulk Send Missing Assignments List for Google Classroom
- Bulk Removing Users From G Suite Admin
- Google Apps Script to Python
- OMG – Google Classroom For Gmail Accounts
Bulk Suspend Google Accounts
Clay Smith has kindly provided this Add-on for free. Hopefully, this will save you a lot of time in having to bulk suspend Google accounts.
First, copy the add-on. Then you will need to go into the Extensions menu menu and modify the Apps Script. So then you can authorize the Admin SDK. Fourth, add your domain to the script and save. So then you can return to the spreadsheet. This will allow you to run the Add-on.