This is "resultMessage" and how it looks like in raw response:
"resultMessage": "{"ComputerName":"","RAM(GB)":16,"CPU":"Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz","Model":"Latitude 5501","SerialNumber":"***"}"
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
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: [https://techcommunity.microsoft.com/t5/device-management-in-microsoft/how-to-collect-custom-inventory-from-azure-ad-joined-devices/ba-p/2280850
PS script deployed to all machines:
$cpu = Get-WmiObject -Class Win32_Processor | select @{n="ComputerName";e={$_.systemname}},@{n="CPU";e={$_.name}}
$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)
[PSCUStOMOBJECT]@{
"ComputerName"=$env:COMPUTERNAME;
"RAM(GB)"=$memory;
"CPU"=$cpu.CPU;
"Model"=$model.Model;
"SerialNumber"=$serialNumber.SerialNumber
} | 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:
When I call it from Azure API management it is the same situation, it has extra curly brackets:
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?
Thanks
This is "resultMessage" and how it looks like in raw response:
"resultMessage": "{"ComputerName":"","RAM(GB)":16,"CPU":"Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz","Model":"Latitude 5501","SerialNumber":"***"}"
Test comment
We found a workaround solution, send information to Log Analytics and after that API pulls data.