Office365用户查询将Photo返回为null

时间:2016-12-08 10:04:49

标签: office365 office365api

尝试使用Microsoft.Graph库检索域上的用户列表:

GraphServiceClient graphClient = SDKHelper.GetAuthenticatedClient();
var request = graphClient.Users.Request().Select("businessPhones, displayName, givenName, id, jobTitle, mail, mobilePhone, officeLocation, preferredLanguage, surname, userPrincipalName, photo");
var ListOfUsers = await request.GetAsync();

范围是:

Scope = "openid email profile offline_access User.Read User.ReadWrite User.ReadBasic.All " + graphScopes,

照片字段始终为空。检索所有用户的照片的正确方法是什么?

1 个答案:

答案 0 :(得分:0)

有一个单独的端点为用户提取照片

graphClient.Users[<UserPrincipalName>].Photo.Content.Request()

请参阅this链接