Pulling Total Physical Memory for Intune Enrolled Devices

Damon Maranya 36 Reputation points
2022-08-12T20:42:53.83+00:00

I have been asked to determine how many of our current fleet of Intune enrolled Windows 10 devices have 4GB of physical memory.

As far as I can tell the best way to get this information without going device by device in MEM is through Microsoft Graph. I can successfully pull all enrolled devices with a device query using Powershell. But the physicalMemoryInBytes attribute shows as 0 for all devices. Regardless of the value displayed on the device's Intune record, or the actual memory in the device.

I can run a targeted query in which I select the attributes I want to see (https://graph.microsoft.com/beta/deviceManagement/manageddevices('<Intune Device ID>')?$select=id,hardwareinformation,physicalMemoryInBytes), and that returns a correct value. But that means iterating through all of the devices one at a time. Which is fine, except I'm just not familiar enough with the syntax used by the Graph API to figure out how to set that query up.

Does anyone have a better way to pull the physicalMemoryInBytes attribute from Intune enrolled devices, or failing that, some insight into how I would build the foreach loop I would need to iterate through the enrolled devices? Alternately does anyone have a good resource on learning to use MS Graph? Today is literally the first time I've touched it.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,114 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,628 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,569 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Iufor 0 Reputation points
    2025-02-23T11:39:24.9733333+00:00

    Hello
    The physicalMemoryInBytes attribute exists for all Intune-enrolled devices in Microsoft Graph yet it requires separate manual queries for each device because it cannot be obtained from bulk requests. The PowerShell script combines Graph API to collect device IDs before it uses a loop method to extract hardware information from each device. Using a basic foreach loop within PowerShell will help users achieve efficient results. The learning materials for Graph API are available through Microsoft Graph documentation and Graph Explorer enables interactive testing of queries.

    0 comments No comments

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.