Microsoft Graph API:获取分配给许可证的用户

问题描述

我正在尝试通过Microsoft graph API将用户分配给许可证。很像在天蓝色

enter image description here

现在,借助chrome devtools,我发现调用以下api来获取此信息 https://main.iam.ad.ext.azure.com/api/AccountSkus/UserAssignments

不幸的是,尝试访问此api确实很麻烦,并且绝对不适合生产

我想知道是否可以通过图API进行类似的操作。

解决方法

https://graph.microsoft.com/beta/users?$select=id,displayName,assignedLicenses,assignedPlans

enter image description here

您可以通过提供LastSignInDateTime和SKU来使用以下查询,以获取特定分配的许可证SKU的用户

  https://graph.microsoft.com/beta/users?$filter=signInActivity/lastSignInDateTime le 2020-08-01T00:00:00Z&assignedLicenses/any(x:x/skuId eq xxx7a907fd6c235)&$select=displayname

enter image description here

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...