Forum Discussion
Graph /users query with mailboxSettings filters/expands excludes unlicensed users
Hello Microsoft Graph team,
I would like to report what appears to be a bug in Microsoft Graph user queries involving mailboxSettings.
Issue summary:
When mailboxSettings is used in a filter or expand clause on /users, unlicensed users are not returned, even when they should match the filter.
Example scenario:
Filter used: mailboxSettings/userPurpose ne 'room'
Observed behavior:
Users without Exchange license/mailbox are excluded from results (or result set appears truncated to mailbox-enabled users).
Expected behavior:
All users should be considered in /users query evaluation.
If a user has no mailbox settings, behavior should be consistent and documented (for example null handling), but those users should not be silently dropped from /users results unless explicitly filtered out by query semantics.
Reproduction steps:
- In a tenant with mixed users:
- Licensed mailbox users
- Unlicensed users without mailbox
- Run a /users query that includes mailboxSettings in filter and/or expand.
- Compare returned users with a baseline /users query without mailboxSettings conditions.
- Notice unlicensed users disappear when mailboxSettings is involved.
Sample request patterns:
- GET https://graph.microsoft.com/v1.0/users?$filter=mailboxSettings/userPurpose ne 'room'
- GET https://graph.microsoft.com/v1.0/users?$expand=mailboxSettings&$filter=mailboxSettings/userPurpose ne 'room'
1 Reply
Not sure how you managed to get any results with the above queries, but they do not work for me. And afaik, mailboxSettings is not supported for filtering, and can only be queried per user.