0
votes

I'm using the Microsoft Graph Explorer to test a few queries. One is to get a list of the Guest user accounts in Azure AD (Azure B2B/B2C).

I use one of the sample queries:

https://graph.microsoft.com/v1.0/users/?$filter=userType%20eq%20'guest'

against a customer's Azure AD and I get back the json results of all the guest users.

But when I run this against my Azure AD tenant, I get this:

The query specified in the URI is not valid. Could not find a property named 'userType' on type 'Microsoft.Fast.Profile.Web.Models._1._0.Profile'.

My Azure AD tenant is license type of "Azure AD Free" - not sure if that is the cause or it matters. I am the global admin of my Azure AD tenant.

Is this due to some other setting in my Azure AD tenant? Or is it because it's Azure AD Free license? I am able to create guest accounts.

1

1 Answers

1
votes

The requested URL is correct. You should sign in with a Member account when using Microsoft Graph Explorer. If you log in to a guest account, it will return this error.

enter image description here

Or you could use client credential flow based on application in Postman. Make sure you have added the appropriate permissions.

Get access token:

POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token 
Content-Type: application/x-www-form-urlencoded

client_id={client_id}
&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default
&client_secret={client_secret}
&grant_type=client_credentials

Call MS Graph API:

GET https://graph.microsoft.com/v1.0/users/?$filter=userType%20eq%20'guest'
Authorization: Bear <access_token>