Regarding insertion of a member to a DL via script

22 views
Skip to first unread message

Sumitav Acharya

unread,
Jan 25, 2022, 2:42:01 PMJan 25
to Google Apps Script Community
Hello all,
I am trying to insert a member to a group/DL via App Script using AdminDirectory API but looks like AdminDirectory is only available to administrators of GSsuite accounts. as the documentation specifies.
So can anyone please help me with the same?


I am struggling for so many days to find "How to insert a member to a group given that you are the manager of that DL via script" but I am not getting any solution.
I would be really grateful if someone can help me out to achieve the same.


Thanks

Clark Lind

unread,
Jan 26, 2022, 9:08:12 AMJan 26
to Google Apps Script Community
You cannot add members to groups unless you are an Admin of a domain. Otherwise, anyone could add anyone else to any group they wish against their will. So no, normal users cannot do this.

Nick Bergstrom

unread,
Jan 27, 2022, 7:45:11 PMJan 27
to Google Apps Script Community
I've looked into this recently and also confirmed adding group members can only be done by Admins via the Directory API.

The GroupsApp class (https://developers.google.com/apps-script/reference/groups/groups-app) gives you read-only access to view members in groups, depending on group permissions. It doesn't have any functions to add or remove members.

If a group has "Member moderation > Who can manage members is set to Group managers" set to Group Managers, any manager can already manage the members via the Groups site, so I wish Google could use the same security settings to allow that for authorized managers via GroupsApp.

Sumitav Acharya

unread,
Jan 29, 2022, 7:35:57 AMJan 29
to Google Apps Script Community

Hello,
Ok 
Can I have some other approach of insertion then? using any other API or google contacts?


thanks
Reply all
Reply to author
Forward
0 new messages