我正在尝试检索域中的所有用户,但这是行不通的。我的代码从未出现任何错误。
我在我的项目中添加了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] 删除。
我来说两句