google-appsgoogle-groupsgoogle-groups-apigoogle-apps-for-education

Need to know whether Google Group is Admin managed or user managed in google apps domain?


I am using Google Apps Provisioning API to play around with google apps domains group settings. I have got the list of the all the groups in a domains but I need to know whethet a particular group is User-Managed or Admin-Managed.

I cannot see any method to get that information. I would need some help here if anybody knows about this. Thanks :)


Solution

  • With Google Apps Script, you could get the Owner list using getAllOwners(), and check to see if the owners of the group are admins. Something like:

    function isAdminManaged(groupName){
      var groupOwners = GroupsManager.getGroup(groupName).getAllOwners();
      for (var owner in groupOwners){
        var userName = groupOwners[owner];
        if(UserManager.getUser(userName).getIsAdmin()){
          return true;
        }
      }
    return false;
    }