MS Graph API $filter via "disabledPlans" AzureAD

MS Graph API $filter via "disabledPlans" AzureAD
1

Upvotes

Upvote

 Aug 02 2022
0 Comments 
New

As per documentation in the Advanced query capabilities on Azure AD directory objects under "User properties" where currently only skid is supported 'assignedLicenses/any(a:a/skuId)'

 

However looking for enabling support to filter using 'assignedLicenses/any(a:a/disabledPlans)' too. As it would help troubleshooting and fix missing EXO cases, which causes broken mailboxes, user issues due to improperly provisioned mailboxes.

 

Facing the following error "Invalid filter clause" when calling graph API for user to filter based on assignedLicenses. Since filter directly via "disabledPlans" is not supported, that's why we are seeing 400 bad request "Invalid filter clause" error message.

 

Currently we can filter via "skuId" since it's a single Guid, but for "disabledPlans" its a collection of the unique identifiers as documented here.

 

I'm aware we can do SDK and client side scripting to get this data, however looking for server side filtering instead for quicker extractions for larger tenants.

 

Below are some references from MS documentation.

 

https://docs.microsoft.com/en-us/graph/query-parameters#filter-using-lambda-operators

 

The assignedLicenses property of the user resource contains a collection of assignedLicense objects, a complex type with two properties, skuId and disabledPlans. The following query retrieves only users with an assigned license identified by the skuId 184efa21-98c3-4e5d-95ab-d07053a96e67.

 

GET https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(s:s/skuId eq 184efa21-98c3-4e5d-95ab-d07053a96e67)