Get CPU and RAM from Intune and GraphAPI

Djordje Novakovic 621 Reputation points


I am collecting hardware information from Intune for our inventory system.

However, CPU and RAM information are not visible in Intune/Graph API.

I created deployed powershell script (which detects CPU and RAM information) in Intune to all Windows computers and now that information is visible in GraphAPI.

I used this tutorial: [

PS script deployed to all machines:

$cpu = Get-WmiObject -Class Win32_Processor  |  select @{n="ComputerName";e={$_.systemname}},@{n="CPU";e={$}}
$model = Get-WmiObject -Class Win32_ComputerSystem | Select-Object Model,Manufacturer
$serialNumber = Get-WmiObject win32_bios | Select-Object SerialNumber
$memory = (Get-WmiObject Win32_PhysicalMemory  | Measure-Object -Sum -Property Capacity).Sum / (1024*1024*1024) 
    } | ConvertTo-Json

When I call Graph API to get results in powershell I receive "something like" JSON format, it is not valid JSON and I am not able to use it like regular JSON file:

User's image

When I call it from Azure API management it is the same situation, it has extra curly brackets:

User's image

Does anyone know how to fix this output and make it useful?

Or anyone has experience how to get CPU and RAM data from Intune?


Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,006 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,078 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Djordje Novakovic 621 Reputation points

    This is "resultMessage" and how it looks like in raw response:

    User's image

    "resultMessage": "{"ComputerName":"","RAM(GB)":16,"CPU":"Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz","Model":"Latitude 5501","SerialNumber":"***"}"

    0 comments No comments

  2. Djordje Novakovic 621 Reputation points

    Test comment

    0 comments No comments

  3. Djordje Novakovic 306 Reputation points

    We found a workaround solution, send information to Log Analytics and after that API pulls data.