The Admin SDK Groups Settings service allows you to use the Admin SDK's Groups Settings API in Apps Script. This API gives administrators of G Suite domains (including resellers) the ability to manage the group settings for groups in their G Suite account.
Reference
For detailed information on this service, see the reference documentation for the Admin SDK Groups Settings API. Like all advanced services in Apps Script, the Admin SDK Groups Settings service uses the same objects, methods, and parameters as the public API.
Sample code
The sample code below uses version 1 of the API.
Get a group's settings
This sample gets a group's settings and logs them to the console.
function getGroupSettings() {
var groupId = 'exampleGroup@example.com';
var group = AdminGroupsSettings.Groups.get(groupId);
Logger.log(JSON.stringify(group, null, 2));
}
Update a group's settings
This sample shows how a group's settings can be changed. Here, the description is modified, but various other settings can be changed in the same way.
function updateGroupSettings() {
var groupId = 'exampleGroup@example.com';
var group = AdminGroupsSettings.newGroups();
group.description = 'Newly changed group description';
AdminGroupsSettings.Groups.patch(group, groupId);
}