3

I am having an issue creating an automation script with Google Apps script.

My function is:

function addToGroup(email, group) {
    // Create a user with membership access
    var user = {
        email: email,
        role: 'MEMBER'
    };
    AdminDirectory.Members.insert(user, group)
}

This works perfectly with GSuite groups, however I get an issue saying 'Domain not found' when I try to use this with a @googlegroups.com group address.

Is there a different method for adding to these types of groups?

Any information is welcome.

Thanks

  • 1
    If you are using a service account to create this request, you still need to act as a Google Apps user in the domain with the proper rights like super admin as stated in this related [SO post](https://stackoverflow.com/a/27180323/5995040). Hope this helps. – Mr.Rebot Sep 17 '17 at 19:24
  • @Mr.Rebot I'm not quite sure what you mean. This is using Google Apps Scripts. It authenticates with my Google login, which (ideally) recognises my roles within the domain. It does so with GSuite domains, but it cannot recognise a googlegroups.com group which I own with the same account. – zomfg_zombie Sep 17 '17 at 22:47
  • 2
    I'm working on something similar and found out Google does not support any kind of modification on Google own's groups (@googlegroups.com). The only way that I can think out is to use cURL to similate the admin user action on the browser... – Trinh Nguyen Oct 09 '17 at 10:23

0 Answers0