Checking Groups Status

20 views
Skip to first unread message

Tim Gustafson

unread,
Mar 13, 2012, 6:55:56 PM3/13/12
to google-app...@googlegroups.com
Hi,

I'm trying to write a PHP script that looks at all the Google Groups in our domain and pulls down their membership lists so that information can be recorded locally in our LDAP server.  I've got a script that looks like this right now:

$groups = $service->retrieveAllGroups();

foreach($groups as $group) {
  # i have not figured out yet how to access properties by their "name", rather
  # than their index in the $group->property array, so I'm making an associative
  # array of all the properties for now

  $properties = array();

  foreach($group->property as $property) {
    $properties[$property->name] = $property->value;
  }

  $members = $service->retrieveAllRecipients($properties["groupId"]);

  foreach($members as $member) {
    # record membership information here
  }
}

However, retrieving the membership list can take quite a while on some of our groups - many of them have more than 1,000 members.  Is there any way to get a "last time a member was added or removed from the group" property so that I can simply skip the ones that have not been updated since the last time I ran the sync script?  Is there a more efficient way of doing this?  Is there any way Google can be configured to "push" updates to us, so that we don't have to "pull" them periodically?

Thanks!

Claudio Cherubino

unread,
Mar 13, 2012, 11:29:19 PM3/13/12
to google-app...@googlegroups.com
Hi Tim,

Unfortunately, the Provisioning API doesn't support push notifications, but there is an open feature request for it in our issue tracker that you can subscribe to:


You can also considering calling the retrievePageOfRecipients() method repeatedly instead of retrieveAllRecipients() in order to retrieve 200 group members at a time instead of having the library iterate through all of them before returning anything.

Claudio


--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/wOB2EfCKDpsJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Tim Gustafson

unread,
Mar 14, 2012, 11:52:51 AM3/14/12
to google-app...@googlegroups.com
> Unfortunately, the Provisioning API doesn't support push notifications, but
> there is an open feature request for it in our issue tracker that you can
> subscribe to:
>
> http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=2785

I have subscribed to that issue.

> You can also considering calling the retrievePageOfRecipients() method
> repeatedly instead of retrieveAllRecipients() in order to retrieve 200 group
> members at a time instead of having the library iterate through all of them
> before returning anything.

That doesn't help, as I'll still have to poll all the users anyhow.

What about the "last updated" time stamp for each group as part of the
retrieveAllGroups() results?

--

Tim Gustafson
t...@soe.ucsc.edu
831-459-5354

Claudio Cherubino

unread,
Mar 14, 2012, 11:57:49 AM3/14/12
to google-app...@googlegroups.com
There is no way to get the last time a member was added or removed to/from a group but feel free to file another feature request for it.
Thanks

Claudio

 

--

Tim Gustafson
t...@soe.ucsc.edu
831-459-5354
--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
Reply all
Reply to author
Forward
0 new messages