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

Microsoft Graph API: Getting the users who are assigned to a licence

我正在尝试通过 Microsoft Graph API 为用户分配许可证。很像 azure

现在感谢 chrome 开发工具,我发现调用以下 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