getByIds only returns users and groups, not devices

Jay 1 Reputation point
2022-04-22T18:52:17.373+00:00

I have the permissions needed to see groups and users, though the docs dont show that i need more for devices.

If i do not specify the type in the body, i can get users and groups without issues, however, with or without type i cannot do it by device id.

I have tried with both the intune device id and also the azure ad device id.

What i can determine from postman and graph explorer that the "id" value of a filtered search of /deviceManagement/managedDevices is that "id" value of the return is the intune device id.

if i do a search for that device using /deviceManagement/managedDevices/{{id}}, i get relevant data.

However, in postman, script, or graph explorer, when i run this command https://graph.microsoft.com/v1.0/directoryObjects/getByIds?$select=id with the body
{
"ids":["44338ff8-XXXX-XXXX-XXXX-5c57452b204b","a589a603-XXXX-XXXX-XXXX-f7b2de609f66","3d872602-XXXX-XXXX-XXXX-19c8e6554b67"]
}

i get a 200 status code and only 1 result, the result being a user. (the ids list contains both devices (intune device id) along with the user id)
if i run the command without the user, i get

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects(id)",
"value": []
}

Essentially i have a list of deviceIds that i need to parse through without running an individual call for each, which could be thousands.\
Not sure if i needed cloudPC permissions since my devices are whitegloved, but i tried it with and without the permissions to no avail.

Community Center Not monitored
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Mehtab Siddique (MINDTREE LIMITED) 971 Reputation points
    2022-04-25T08:22:31.473+00:00

    Hi @Jay , I think there is an existing issue going on with "getByIds request"

    ![196072-image.png]2
    please refer this DOC for the reference, Hope this helpfull.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Jay 1 Reputation point
    2022-04-25T16:40:18.38+00:00

    I knew i forgot to add something.

    I had already tried that to no avail, see screenshot.
    worse even, i tried to took at the metadata to see whats accepted as the directory object but those attempts seem futile.

    have you tried this on your end to test? 196249-screen-shot-2022-04-25-at-103824-am.png

    For posterity, i also tried something a bit more aligned with the rest of the msft naming scheme
    196197-screen-shot-2022-04-25-at-104121-am.png

    0 comments No comments

  3. Jay 1 Reputation point
    2022-04-28T17:48:54.143+00:00

    any updates on this?

    at this point in order for me to get the userId's of the devices i have to run about 1200 individual calls, which is not scalable.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.