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.