1
votes

I am trting to get all admin users from Office365 using Graph Users API. But userType of Admin users is null. Due to this I am not able to apply filter userType eq null. Is there any option to get only Admin users? https://graph.microsoft.com/v1.0/users?$filter=userType eq null

error response:

{
    "error": {
        "code": "Request_UnsupportedQuery",
        "message": "Unsupported or invalid query filter clause specified for property 'userType' of resource 'User'.",
        "innerError": {
            "date": "2020-07-01T17:14:04",
            "request-id": "resource-id"
        }
    }
}
1
You may need to use roles rather than user types - TylerH
is there any API to get the user roles? - Krishna Anumothu
Sorry, I'm not very familiar with Microsoft Graph, moreso with PowerShell. - TylerH

1 Answers

0
votes

You need to use the unifiedRoleAssignments Api to list all the members of the Global/Company administrator role