使用Google Apps Provisioning API检索所有用户?

阿努拉格·贾恩(Anurag Jain)

我正在尝试检索域中的所有用户,但这是行不通的。我的代码从未出现任何错误。

我在我的项目中添加了Google.GData.Apps.dll作为参考。我正在使用Google Apps Provisioning API。我指的是这些链接https://developers.google.com/google-apps/provisioning/

代码 :-

    string domain = @"<domain name>";
    string subs = @"<Authorization code>";

    AppsService appService = new AppsService(domain, subs);

   // appService.CreateUser("john.jain","James","anderson","james@1234");
   // appService.DeleteUser("Amitesh");

    appService.RetrieveAllUsers();
罗伯·波特

以下对我有用:RetrieveAllUsers()返回包含所有用户的UserFeed对象。请注意,我为Apps服务使用了其他构造函数(使用用户名/密码凭据而不是OAuth)。

this.appsService =新的AppsService(credential.Domain,credential.Username,credential.Password); 
UserFeed userFeed = this.appsService.RetrieveAllUsers(); 

//选择除域超级管理员以外的所有用户。
var usernamesInDomain = 
  (来自userFeed.Entries
   中的UserEntry用户,其中user.Login.Admin!= true
   选择user.Login.UserName).ToList();

在您的情况下,返回的UserFeed对象包含什么?

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

是否可以让所有用户都来自同一Google Apps域?

为除管理员外的所有用户触发Google Apps脚本

是否要从Google Analytics API检索所有用户ID数据?

如何从 google api 访问所有用户设置?

使用 Google Apps 脚本从 Firebase 检索数据

使用REST API在Jira中查找所有用户

如何使用Parse Javascript API查询所有用户

azure ad 使用图形 api 获取所有用户

使用Google Apps脚本获取Instagram API

查找所有未使用两因素身份验证的Google Apps用户

使用 Google Apps Script for Google Sheets 检索测验结果

使用 Python API 列出 Google Cloud 中项目中的所有用户

使用Google Apps脚本从图表中获取所有系列

如何使用MS Graph SDK检索所有用户属性

如何使用Google Apps脚本检索用户在Google表单中的“其他”字段中输入的值?

在Google Apps脚本中使用google docs api

使用Google Apps脚本响应Google Calendar API的推送通知

使用php和mysql从所有用户的朋友中检索用户配置文件数据

Google Apps独立脚本,可使用Google Apps Script API更新许多绑定的脚本

对所有用户使用相同的脚本

一个带有用户管理功能的问卷调查应用 Google Apps Script 和 Google Sheets

使用google-api-nodejs-client的Google Apps用户名的OAuth 2.0范围

是否有用于模糊查找的Google Apps脚本?

使用户输入独立的Google Apps脚本代码

如何使用flickr API为所有用户获取带有地理标签的照片?

使用Google Apps脚本删除Google表格中的所有过滤器

Google Calendar API使用Apps脚本批量插入事件

无法使用 Google Apps 脚本更新 contactusgin People api

无法使用 Drive API 在 Google Apps 脚本中获取文件