Forum Discussion

Ricey_'s avatar
Ricey_
Copper Contributor
Jan 29, 2021

Total physical memory attribute graph location

Hey All,

 

I'm currently looking for where the "Total physical memory" attribute under hardware on an intune device is stored in Graph.

I'm searching in https://graph.microsoft.com/beta/deviceManagement/managedDevices and find 

physicalMemoryInBytes but it's set to 0 on all the devices I look at but these same devices have a value showing in intune.
 
Any help would be greatly appreciated. 
  • Hey Ricey_,

     

    you have to query for it explicitly by using select, otherwise you will always get back 0...

     

    https://graph.microsoft.com/beta/deviceManagement/manageddevices('123-123-123-123-123')?$select=id,hardwareinformation,activationLockBypassCode,iccid,udid,roleScopeTagIds,ethernetMacAddress,processorArchitecture,physicalMemoryInBytes 

     

    [...]

    "processorArchitecture": "x64",
    "physicalMemoryInBytes": 2147483648,
    [...]
     
    This way you will get the values you are searching for.

     

    best,

    Oliver

    • anzicsrecko's avatar
      anzicsrecko
      Copper Contributor
      Not working. It always returns "physicalMemoryInBytes": 0. Intune shows 8GB.
      • Luka Pustahija's avatar
        Luka Pustahija
        Copper Contributor
        It works through MS graph web application and I have value in the response, but when I put that request as Uri in a PowerShell Invoke-RestMethod value is always 0.
        I'm pretty sure that similar request worked a few months back. Any idea what could be wrong?
    • Ricey_'s avatar
      Ricey_
      Copper Contributor

      Oliver Kieselbach 

      Great that worked thanks a lot for your help.

       

      So to get all my devices and the amount of RAM would have to query each device ID separately?

    • AlanL1969's avatar
      AlanL1969
      Copper Contributor

      Oliver Kieselbach 

      Not working for me.
      "error": {
      "code": "BadRequest",
      "message": "Parsing OData Select and Expand failed: Term 'id,hardwareinformation,activationLockBypassCode,iccid,udid,roleScopeTagIds,ethernetMacAddress,processorArchitecture,physicalMemoryInBytes [...] \"processorArchitecture\": \"x64\", \"physicalMemoryInBytes\": 2147483648, [...]' is not valid in a $select or $expand expression.",

Resources