Warm tip: This article is reproduced from serverfault.com, please click

azure active directory-为什么使用 Graph API 的 licenseAssignmentStates 集合中缺少分配的许可证?

(azure active directory - Why are assigned licenses missing from the licenseAssignmentStates collection using Graph API?)

发布于 2020-08-21 07:40:09

我的 Azure AD 中的用户有两个许可证分配,一个是直接分配的,另一个是通过组分配的:

Azure AD 屏幕截图

查询用户时,licenseAssignmentStates 集合中缺少其中一个许可证。属性assignedLicenses 包含其他许可证。

https://graph.microsoft.com/v1.0/users/[UPN]?$select=licenseAssignmentStates,assignedLicenses

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(licenseAssignmentStates,assignedLicenses)/$entity",
    "licenseAssignmentStates": [
        {
            "skuId": "18181a46-0d4e-45cd-891e-60aabd171b4e",
            "disabledPlans": [],
            "assignedByGroup": "19f1820f-21d0-4d68-8c51-678a752168bc",
            "state": "Error",
            "error": "MutuallyExclusiveViolation"
        }
    ],
    "assignedLicenses": [
        {
            "disabledPlans": [
                "aebd3021-9f8f-4bf8-bbe3-0ed2f4f047a1",
                "8c7d2df8-86f0-4902-b2ed-a0458298f3b3",
                "57ff2da0-773e-42df-b2af-ffb7a2317929",
                "a23b959c-7ce8-4e57-9140-b90eb88a9e97",
                "e95bec33-7c88-4a70-8e19-b10bd9d0c014",
                "5dbe027f-2339-4123-9542-606e4d348a72"
            ],
            "skuId": "6fd2c87f-b296-42f0-b197-1e91e994b900"
        }
    ]
}

这是一个很大的问题,因为如果 licenseAssignmentStates 集合中没有包含许可证,就不可能知道许可证分配的状态或它是否已由组分配。

在添加间接许可证分配之前,直接许可证分配是在 licenseAssignmentStates 集合中返回的,所以我认为不是那个。

如何获取所有已分配许可证的 licenseAssignmentStates?我做错了什么还是Graph API中的错误?如果是,那么快速修复它的最佳方法是什么,我们的应用程序需要它吗?

非常感谢你提前!

Questioner
Manuel K
Viewed
0
Manuel K 2021-01-07 16:32:08

Microsoft 已将其记录为错误,并在等待解决:https : //github.com/microsoftgraph/microsoft-graph-docs/issues/9636#issuecomment-754933971