Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Graph API从Azure AD获取正确的电话属性_Azure_Microsoft Graph Api - Fatal编程技术网

使用Graph API从Azure AD获取正确的电话属性

使用Graph API从Azure AD获取正确的电话属性,azure,microsoft-graph-api,Azure,Microsoft Graph Api,我正在尝试使用Graph API从Azure广告中获取用户手机,但运气不好 如果我在Powershell中使用MsOnline模块并发出以下命令: get-azureAdUser | select userPrincipalName,mobile,telephonenumber 我得到一个用户列表,包括所有的电话号码 但是如果我在图形中使用命令 https://graph.microsoft.com/v1.0/users?$select=userPrincipalName,mobile

我正在尝试使用Graph API从Azure广告中获取用户手机,但运气不好

如果我在Powershell中使用MsOnline模块并发出以下命令:

  get-azureAdUser | select userPrincipalName,mobile,telephonenumber 
我得到一个用户列表,包括所有的电话号码

但是如果我在图形中使用命令

 https://graph.microsoft.com/v1.0/users?$select=userPrincipalName,mobilephone,businessphones
电话区是空的。该列表包含相同的用户,但缺少很多信息

是否可以使用其他命令使用Graph API获取电话号码?

需要检查的内容很少-

  • 请检查您正在使用的访问令牌是否具有必要的权限。请参阅了解访问所需的权限。 例如,您需要使用Directory.Read.All或User.Read.All。然而,两者都需要管理员同意

  • >P>也考虑个人微软帐户(MSA)无法使用电话号码。他们只返回工作/学校账户(AAD)

    如果您仍然面临问题,请从Graph Explorer共享请求id和时间戳

    如果这有帮助,请投票。谢谢