Google Groups for Gsuite is a product that allows admins to create mailing lists for their domain. It is different than the public-facing Google Groups forums. When an admin makes a new Google Group for their domain, by default, the email address for that group is available in their domain's directory. That means that every user in the domain has the group's email address autocomplete when they type in the "To:" field in Gmail. There is no way to change that setting unless you do it programatically via the Admin Group Settings API.
In order to make our Admin's lives easier, I created this script. It simply grabs all of the groups on your domain and lets you toggle whether they are or are not included in the directory.
Note: This project must be initially created by a domain administrator account
- Log in as a domain administrator and create a new Google Apps Script project in Google Drive.
- Copy and paste the code from
code.gs
in this repository intocode.gs
in the Apps Script project - Create a new html file in your project with the
Files ➕
button in the left sidebar, chooseHTML
, name itindex
(.html is added automatically), and copy the code fromindex.html
from this repository into it. - In the
Services ➕
section on the left sidebar, scroll down and turn on the Admin Directory API and Groups Settings API. - On
line 19
ofcode.gs
, changeyourdomain.com
to your domain name. - Click
Deploy
→New deployment
. Choose the level of access that you want to have on the panel (UnderWho has access
), and clickDeploy
.
You're done! Navigate to that web app URL to see your groups and modify each one's setting.
When updates are released here on Github, simply copy and paste the newer code.gs
and index.html
files to your project, make sure your domain name on line 19
of code.gs
is correct, and go to Deploy
→ Manage deployments
. Click the ✏️ Edit
button in the top right of your current deployment, choose New version
under the Version
dropdown, and click Deploy
. You should be good to go!
Feel free to take a look at the source and adapt as you please. I would love to see some pull requests for improvements to the Javascript.
This source is licensed as follows:
Google Group Directory Unlister is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.