Gathering Custom Inventory with Intune
Currently Microsoft Intune does not allow you customize the data it inventories for devices - there is a limited amount of inventory collected out of the box but there is no supported process to add to or change what is inventoried. If you are used to using MEMCM to gather hardware inventory from your devices on a schedule and customize what is gathered, you may be disappointed that there is no equivalent process in Intune.
That doesn't mean it's impossible, however, and there are some creative ways to do this, but most of them have some limitations. A key mechanism to use is Proactive remediations. Yes, the name clearly indicates that is was not intended for gathering inventory data but rather remediating client-side issues, but in any case it's an incredibly useful mechanism that sort of functions like a centrally-managed task scheduler and opens many possibilities for creative use.
For example, the guys over at MSEndpointMgr.com wrote a nice blog about how you can use PR to gather inventory data directly into a log analytics workspace, although you do need to add your workspace ID and access key to the script which will get cached on the local machine.
Another way to do this is to use PR to report the inventory data in the script output which essentially adds the data to Microsoft Graph and allows you to use either the MEM portal or the Graph API to retrieve it. A limitation here is that currently the output must be 2048 characters or less, so for large inventory gathering you'd need to break it up into multiple scripts.
In this guide, I'll show you how to gather inventory in this way by using an Azure automation runbook to export the data from Microsoft Graph on a schedule and save it either to an Azure storage account or a Log Analytics workspace, where it can serve as a data source for Power BI reports, or Azure Monitor workbooks.