Tech Accelerator: Microsoft Intune Suite
Apr 11 2023 08:00 AM - Apr 12 2023 11:00 AM (PDT)

physicalMemoryInBytes always returns 0

Occasional Visitor

I followed the blog below,

https://techcommunity.microsoft.com/t5/microsoft-intune/total-physical-memory-attribute-graph-locati...

 

Here is my API endpoint. 

https://graph.microsoft.com/beta/deviceManagement/manageddevices('1111-2222-3333-abc4-55aa55bb55')?$select=id,physicalMemoryInBytes

 

Here is the response,

{"@odata.context":"https://graph.microsoft.com/beta/$metadata#deviceManagement/managedDevices(id,physicalMemoryInBytes)...","id":"1111-2222-3333-abc4-55aa55bb55","physicalMemoryInBytes":0}

 

The expected response is 32GB (in bytes).

 

Can someone please help?

 

5 Replies

Have the same issue when using id, physicalMemoryInBytes. But.. If you use
?$select=hardwareinformation,physicalMemoryInBytes it does show it :)
"@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/managedDevices(hardwareInformation,physi...",
"physicalMemoryInBytes": 34359738368,
"hardwareInformation": {

Did this answer your question?
Thanks Harm, but unfortunately this isn't resolving this issue for me

I have replicated your query exactly, but firstly Graph does not recognize the property hardwareInformation : Parsing OData Select and Expand failed: Could not find a property named 'hardwareInformation' on type 'microsoft.graph.managedDevice'.

I've tried similar queries replacing hardwareInformation with other random properties, and the results always return as 0 for physicalMemoryInBytes. Tried devices of all OS types as well, and get the same result whether I query data for all devices or a single device Id.

Here's an example query context
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#deviceManagement/managedDevices(operatingSystem,physicalM...",
"operatingSystem": "Windows",
"physicalMemoryInBytes": 0

No matter what I try, always getting 0. The only thing I can think of is because it's defaulting to v1.0 instead of Beta? Or this is just broken

First I tried the Graph PowerShell SDK (because I prefer PowerShell, naturally), but I get 0 values for physicalMemoryInBytes for all devices returned from this command:
Get-MgDeviceManagementManagedDevice

Not finding anything else on the net, I wonder if this has been raised with MS..

I need to pull a report on company inventory including RAM :(
Think I'm going to do it manually from Intune GUI. Lucky not such a big tenant in this case, but really should expect this should work by now?
Surely I'm not the only one who still needs to get device inventory including Memory size, unless there's a different location to get it..
Have tried that too in the last few months, nothing :( I see more people asking for this information, but no response/update yet
https://graph.microsoft.com/beta/deviceManagement/manageddevices('<insert your deviceID here>')?$select=id,hardwareinformation,physicalMemoryInBytes

That will return the physicalMemory. Note that it won't work for /v1.0, only /beta. We haven't updated the v1.0 schema with that information yet, that's why it's failing for you. Currently the only solution is to include hardwareInformation in the $select clause along with the physicalMemoryInBytes property.