获取 Google Apps 域的用户计数

发布于 2024-07-21 13:30:52 字数 225 浏览 5 评论 0原文

如何获取 Google Apps 域中的用户总数? 我知道“检索域中的所有用户”调用使用 Google 配置 API,但我不想执行如此密集的调用只是为了统计所有用户。 有没有更简单的方法来做到这一点?

How do you get the total number of users in a Google Apps Domain? I'm aware of the "Retrieve All Users in Domain" call using the Google Provisioning API, but I'd rather not execute such an intensive call just to count up all the users. Is there a simpler way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

思念满溢 2024-07-28 13:30:54

Google Apps 管理设置 API 允许您检索域中的当前用户数和最大用户数:

https://developers.google.com/google-apps/admin-settings/#retriving_the_current_number_of_users_in_a_domain

这比报告 API 更可取,因为它的流量较低,而且更接近实时(报告仅每 24 小时更新一次,因此不会考虑最近添加的用户)。

The Google Apps Admin Settings API allows you to retrieve both the current and maximum number of users in the domain:

https://developers.google.com/google-apps/admin-settings/#retrieving_the_current_number_of_users_in_a_domain

this would be preferable to the reports API as it's both lower in traffic and it's closer to real time (reports are only updated every 24 hours so it won't take into account users recently added).

水溶 2024-07-28 13:30:54

您可以尝试“检索域中的所有昵称”,这可以节省一些带宽,因为它希望实际上只检索昵称,尽管我认为这不会为您提供确切的计数,因为“检索用户的所有昵称”似乎暗示用户可以有多个昵称。

如果您有一些测试域,还要确保检索所有用户确实开销太大,并且请记住,根据您想要执行的操作,您也许可以围绕它构建某种缓存,仅在之后执行完整请求缓存早于 X。

You could try "Retrieve All Nicknames in Domain" which could save some bandwidth as it hopefully really only retrieves the nicknames, although I think this won't get you the exact count because "Retrieve All Nicknames for a User" seems to imply that a user can have multiple nicknames.

If you've got some test domain, also assure that retrieving all users really is too much overhead and keep in mind that depending on what you want to do, you can perhaps build some kind of cache around it that only does a full request after the cache is older than X.

朮生 2024-07-28 13:30:52

我找到了一个不像检索所有用户那样占用大量资源的解决方案: Google Reporting API 可用于获取 Google Apps 域中的帐户总数。

I found a solution that isn't as resource-heavy as retrieving all users: The Google Reporting API can be used to get the total number of accounts in a Google Apps domain.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文