2016-12-08 18 views
0

試圖檢索使用Microsoft.Graph庫上的域用戶的列表:Office365用戶查詢返回的照片作爲空

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, 

照片字段始終空值。什麼是爲所有用戶檢索照片的正確方法?

回答

0

有一個單獨的端點,以獲取照片的用戶

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

請參考this鏈接

+0

我如何獲得的圖像遠程URL? – Ateik