How find GroupsAssigningLicense in Graph (PowerShell)

Smagacz, Joanna 40 Reputation points
2023-04-03T09:26:34.98+00:00

Hello,

I have a question that in Graph exist comment which returns the same output as this syntax in msol:

(Get-MsolUser -UserPrincipalName 'test@test.com').licenses.GroupsAssigningLicense.Guid

Best regards

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,546 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 110K Reputation points MVP
    2023-04-03T09:35:08.9533333+00:00

    Use the licenseAssignmentStates property. Here's an example:

    GET https://graph.microsoft.com/beta/users/{userId}?$select=licenseAssignmentStates

    And the output:

    {
        "@odata.context": "https://graph.microsoft.com/beta/$metadata#users(licenseAssignmentStates)/$entity",
        "licenseAssignmentStates": [
            {
                "skuId": "6fd2c87f-b296-42f0-b197-1e91e994b900",
                "disabledPlans": [],
                "assignedByGroup": null,
                "state": "Active",
                "error": "None",
                "lastUpdatedDateTime": "2020-03-04T08:12:13.9961249Z"
            },
            {
                "skuId": "87bbbc60-4754-4998-8c88-227dca264858",
                "disabledPlans": [],
                "assignedByGroup": "84b18857-3c01-48be-b707-492019c57142",
                "state": "Active",
                "error": "None",
                "lastUpdatedDateTime": "2021-03-30T09:31:44.7987025Z"
            }
        ]
    }
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.