问题描述
我正在尝试通过Microsoft graph API将用户分配给许可证。很像在天蓝色
现在,借助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
您可以通过提供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