0
votes

I use the interface to get a list of users

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

        {
            "id": "405209fe-0b79-4f9c-b1f5-4457a28986c8",
            "displayName": "0006",
            "accountEnabled": true,
            "userPrincipalName": "0006@xxx",
            "assignedLicenses": []
        }

I want to get a list of users who are not assigned licenses

"assignedLicenses": []

1

1 Answers

0
votes

There is no way as of now that can filter the assignedLicenses which are empty using ODATA filter query parameter. You should be using the same query

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

And get the users list and filter it on your end(by writing code) where the assignedLicenses array is an empty array.