microsoftgraph / microsoftgraph/msgraph-beta-sdk-python

devices expand=registeredUsers does only return the id

Open
#1,006 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:waiting-for-triage type:bug
Dominant language
Python
Stars
44
Forks
16
Avg merge
20h 39m
Merged PRs (30d)
3

Description

Describe the bug

Using the devices endpoint in graph and the parameter expand=registeredUsers is supposed to return (all) values for all registered users.
Each registered user is supposed to be of type #microsoft.graph.user
Using graph-explorer, this works, i.e. https://graph.microsoft.com/beta//devices?$expand=registeredUsers
will contain a list of microsoft.graph.user objects in the registeredUsers property, where each user has attributes like mail, imAddresses etc filled.
Using the SDK only the id property for the microsoft.graph.user object is filled, i.e. all other properties are None or empty collections.

Is this a bug or something on my end I don't understand?

my calling code (broken down):

request_config = DevicesRequestBuilder.DevicesRequestBuilderGetQueryParameters(
        top=20,
        expand=['registeredUsers']
    )
self._event_loop.run_until_complete(self._graph_service.devices.get(request_config))

where _event_loop == asyncio.get_event_loop()
and _graph_service == GraphServiceClient

Expected behavior

A list of devices is returned, where registered Users of type #microsoft.graph.user in the device's registeredUsers property have more properties filled than just the ID

How to reproduce

See description

SDK Version

1.56.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

No response

Configuration
  • OS: MacOS 26.3.1
  • Arch: Apple Silicon
  • Python: 3.13.7 (venv)
Other information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the request through GraphServiceClient and DevicesRequestBuilder with expand=['registeredUsers'], then compare the SDK response with the Graph Explorer response. Trace how registeredUsers is represented and populated in the returned device objects; done means expanded users expose properties beyond id, matching the service response.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.