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.
Pulling Total Physical Memory for Intune Enrolled Devices
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.
2 answers
Sort by: Most helpful
-
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
-
Iufor 0 Reputation points
2025-02-23T11:39:24.9733333+00:00