开发者

How can i get list of domain users from Google Apps account without administrative access?

开发者 https://www.devze.com 2023-03-15 15:11 出处:网络
This is a similar question to How can i get list of Domain user's from Google Apps account? However, I\'d like to use a normal account (not an administrative account) to retrieve the user list.It

This is a similar question to How can i get list of Domain user's from Google Apps account?

However, I'd like to use a normal account (not an administrative account) to retrieve the user list. It seems lik开发者_如何学运维e this should be possible as the gmail autocomplete returns domain contacts not listed in the user's contact store. I've looked at the autocomplete Ajax call, but it requires something in the beginning of the string (and no, I don't really want to loop through a-z one by one - that is just way to hacky). For example:

https://mail.google.com/mail/c/u/0/data/contactstore?ac=true&ct=true&gp=true&hl=en&id=domain&max=15&out=js&tok=beginningOfUsersName&type=4

Both versions of the Google contacts API seem to omit domain users unless you have them imported into your own contacts list. I've also looked at querying users in the "Coworkers" system group, all to no avail. I also find it interesting that "add a coworker's calendar" on Google calendar does not provide autocomplete - they use a popup instead.

I'm working on a C# project, but this is a general Google API question, so any pointers in any language would help.


Update

It looks like this is feasible now with admin/directory google api endpoints see: https://developers.google.com/admin-sdk/directory/v1/guides/manage-users?authuser=0#retrieve_users_non_admin

Original answer

I was able to work around this issue, so I'll document the workaround, even if it doesn't involve Google. I wrote a program (in C#) to query the internal Active Directory (LDAP) store and pick up all the users from there instead. At that point I could get their email addresses and query Google with it. Not the best method, but it worked for my needs.

The C# was roughly patterned from this powershell script, although I pulled out the computers query and added in the capture of the user's email address: http://www.visualbasicscript.com/List-all-users-or-computers-in-the-default-domain-m35650.aspx

The LDAP property I included to get the proper email address for Google was 'proxyAddresses', although this will not be correct for all environments.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号