Skip to content

Set up Enhanced Inventory

Set up Enhanced Inventory

Enhanced Inventory is a PowerShell-based (Windows) and shell-based (macOS) collection pipeline that gathers device facts Intune doesn’t track natively — hardware specs, monitor model and serial, disk health, battery health, Microsoft 365 channel, driver inventory, and warranty data — and sends them to your Azure Log Analytics workspace via the Log Ingestion API. BI for Intune reads from that workspace to populate the Firewall Status, App Inventory, Driver Inventory, Microsoft 365, Monitor, Disk, Battery, and Warranty dashboards.

  • BI for Intune installed and configured (the Setup Guide is complete).
  • A Log Analytics workspace set up per Set up the Log Analytics workspace, including the BI for Intune app registration’s Log Analytics API Data.Read permission and its Log Analytics Reader role on the workspace. If you also use Windows Update for Business reports, both add-ons share that same workspace.
  • Microsoft Entra: Application Administrator or Global Administrator.
  • Azure: Contributor or Owner on the target subscription or resource group, plus User Access Administrator or Owner to assign roles (only required for automatic RBAC assignment in Step 2).

The Enhanced Inventory scripts use a dedicated Microsoft Entra application to authenticate to Azure and send data via the Log Ingestion API. This is separate from the main BI for Intune app registration.

  1. In the Azure portal, go to Microsoft Entra ID > Enterprise applications.
  2. Select New application > Create your own application.
  3. Enter a name (for example, PowerStacks-CustomInventory).
  4. Select Integrate any other application you don’t find in the gallery.
  5. Select Create.
  6. From the Enterprise Application overview page, record the Object ID.

Switch to the App Registrations pane to get the credentials the inventory scripts will use:

  1. Go to Microsoft Entra ID > App registrations.
  2. Find the application you just created (search by name).
  3. From the Overview page, record the Directory (Tenant) ID and the Application (Client) ID.
  4. Go to Certificates & secrets > New client secret. Enter a description, select an expiration period, and select Add.
  5. Immediately record the Value (not the Secret ID). The value is only shown once.

By the end of this step you should have:

ValueWhere to find itUsed by
Enterprise App Object IDEnterprise Applications > OverviewARM deployment template
Directory (Tenant) IDApp Registrations > OverviewInventory scripts
Application (Client) IDApp Registrations > OverviewInventory scripts
Client Secret ValueApp Registrations > Certificates & secretsInventory scripts

This step uses a one-click ARM template to configure the custom tables, Data Collection Endpoint (DCE), and Data Collection Rule (DCR) in your existing Log Analytics workspace.

The deployment creates:
  • Custom Log Analytics tables: PowerStacksDeviceInventory_CL, PowerStacksAppInventory_CL, PowerStacksDriverInventory_CL
  • A Data Collection Endpoint (DCE)
  • A Data Collection Rule (DCR)
  • Automatic RBAC assignment (if the Enterprise App Object ID is provided)

Select the button below to deploy:

Deploy to Azure

During deployment you will be prompted for:

  • Workspace selection — select Use an existing workspace to reuse the workspace from your WUfB Reports setup.
  • Workspace details — provide the subscription ID, resource group name, and workspace name.
  • Enterprise App Object ID — paste the Object ID from Step 1.

After deployment completes, capture the outputs:

  1. In the Azure portal, go to Resource group > Deployments.

  2. Select the deployment name.

  3. Select the Outputs tab and record:

    OutputUsed by
    DceURIInventory scripts
    DcrImmutableIdInventory scripts

Step 3: Deploy the Windows inventory script

Section titled “Step 3: Deploy the Windows inventory script”

The script gathers data from each Windows endpoint and sends it to the Log Analytics workspace via the Log Ingestion API.

Download Intune_Windows_Inventory.ps1 from the PowerStacks Windows-Enhanced-Inventory repository.

Update the following settings near the top of the script:

ParameterValue
LogAPIModeLogIngestionAPI
TenantIdDirectory (Tenant) ID from Step 1
ClientIdApplication (Client) ID from Step 1
ClientSecretClient Secret value from Step 1
DceURIFrom Step 2 outputs
DcrImmutableIdFrom Step 2 outputs

Each major inventory category can be turned on or off independently. The defaults work for most BI for Intune deployments.

VariableDescriptionDefault
CollectDeviceInventoryHardware inventory (CPU, memory, disks, monitors, chassis, OS install date, battery)$true
CollectAppInventoryInstalled Win32 applications$true
CollectDriverInventoryInstalled and optional drivers$true
CollectMicrosoft365Microsoft 365 update channel and compliance (sub-toggle of device inventory)$true
CollectWarrantyWarranty lookups via vendor APIs (sub-toggle of device inventory)$false
CollectUWPInventoryUWP (modern app) inventory in addition to Win32 (sub-toggle of app inventory)$false
MatchDriversMatch installed driver packages to PnP devices for richer driver records$true
RemoveBuiltInMonitorsExclude internal laptop monitors from monitor inventory$false
WarrantyMaxCacheAgeDaysDays before cached warranty data is refreshed from the vendor API180
WarrantyForceRefreshIgnore the local cache and force a fresh warranty API lookup$false

If CollectWarranty is enabled, you need API credentials from each vendor whose devices you want to look up. The Warranty dashboard remains blank for vendors you don’t supply credentials for; the script skips them silently.

  • Dell — apply at Dell TechDirect for a Client ID and Client Secret.
  • Lenovo — contact your Lenovo account representative to request a Client ID. There is no self-service portal.
  • HP — sign up at the HP Developer Portal or work with your HP rep for a Client ID and Client Secret. HP secrets expire frequently and must be refreshed.
  • Getac — contact your Getac account representative for API credentials.

Fill in the credentials you have:

Terminal window
$WarrantyDellClientID = "<your Dell client ID>"
$WarrantyDellClientSecret = "<your Dell client secret>"
$WarrantyLenovoClientID = "<your Lenovo client ID>"
$WarrantyHPClientID = "<your HP client ID>"
$WarrantyHPClientSecret = "<your HP client secret>"

Deploy the script as a detection script in an Intune remediation:

  1. In the Intune admin center, go to Devices > Remediations.
  2. Create a new remediation package.
  3. Upload Intune_Windows_Inventory.ps1 as the detection script.
  4. Set Run this script using the logged-on credentials to No. The script runs as SYSTEM.
  5. Set Run script in 64-bit PowerShell to Yes.
  6. Assign the remediation to your target device groups.
  7. Set the schedule to run once per day.

Step 4: (Optional) Deploy the macOS inventory script

Section titled “Step 4: (Optional) Deploy the macOS inventory script”

If you also manage macOS devices, deploy the macOS script to extend the same custom-inventory pattern to Mac endpoints.

Download Mac_Custom_Inventory.sh from the PowerStacks Mac-Enhanced-Inventory repository.

Update the following settings near the top of Mac_Custom_Inventory.sh:

ParameterValue
LogAPIModeLogIngestionAPI
TenantIdDirectory (Tenant) ID from Step 1
ClientIdApplication (Client) ID from Step 1
ClientSecretClient Secret value from Step 1
DceURIFrom Step 2 outputs
DcrImmutableIdFrom Step 2 outputs
VariableDescriptionDefault
CollectDeviceInventoryHardware inventory (CPU, memory, disks, battery, model)true
CollectAppInventoryInstalled-application listtrue
InventoryDateFormatdate format string for the final status timestamp"%m-%d %H:%M"

Deploy the script via Intune Shell scripts:

  1. In the Intune admin center, go to Devices > macOS > Shell scripts.
  2. Upload Mac_Custom_Inventory.sh.
  3. Set Run script as signed-in user to No. The script runs as root.
  4. Set Script frequency to Every 1 day.
  5. Assign the script to your target device groups.

Step 5: Grant BI for Intune read access to the workspace

Section titled “Step 5: Grant BI for Intune read access to the workspace”

The main BI for Intune app registration reads inventory data from this Log Analytics workspace using the Log Analytics Reader role. This is configured in Set up the Log Analytics workspace. If you completed that page, this is already done; confirm the role is assigned and continue. Without it, data flows into the workspace but the Enhanced Inventory dashboards stay blank.

Step 6: Connect BI for Intune to the Log Analytics workspace

Section titled “Step 6: Connect BI for Intune to the Log Analytics workspace”
  1. In the Power BI service, open the BI for Intune workspace.
  2. Open the BI for Intune semantic model settings.
  3. Expand Parameters and update:
    • AzureAD LogAnalytics Enable = TRUE
    • AzureAD LogAnalytics WorkspaceID = the Workspace ID of the Log Analytics workspace from Step 2. Find it at Azure portal > Log Analytics workspaces > your workspace > Overview > Workspace ID.
  4. Select Apply.

Optional: secretless ingestion with a managed identity

Section titled “Optional: secretless ingestion with a managed identity”

By default, each endpoint authenticates with the inventory app registration’s client secret, set in the script in Step 1 and Step 3. This is the supported default, the simplest to run, and the reason the separate Enterprise Application is required.

If a security review objects to a write-capable secret on every device, there is an optional path that removes it. You deploy a small Azure Function into your own subscription, and endpoints post their inventory to that Function instead of straight to the Log Ingestion API. The Function writes to your Data Collection Rule using its own system-assigned managed identity, so no Entra client secret is distributed to endpoints, and the inventory-upload app registration is no longer needed.

To enable it, deploy the ingestion Function with the deploy script in the EnhancedInventoryDeploy repository, then set FunctionUrl in the inventory script to the URL it prints and leave the TenantId, ClientId, and ClientSecret placeholders as-is. Setting FunctionUrl switches the script to the secretless path; clearing it returns to the default.

After the script has run on at least one device, verify data is flowing:

  1. In the Azure portal, go to your Log Analytics workspace.

  2. Go to Logs and run:

    PowerStacksDeviceInventory_CL
    | take 10

If data appears, the pipeline is working. For deeper troubleshooting, run the LogIngestionAPI_CheckDCR PowerShell script from the EnhancedInventoryDeploy repository.

After data starts flowing, the following BI for Intune dashboards populate:

  • Firewall Status
  • App Inventory
  • Driver Inventory
  • Microsoft 365
  • Monitor
  • Disk
  • Battery
  • Warranty (per-vendor data depends on warranty API credentials supplied in Step 3)

The scripts write three custom tables to your Log Analytics workspace:

  • PowerStacksDeviceInventory_CL — hardware (CPU, memory, disks, monitors, battery, chassis), Microsoft 365 channel, warranty
  • PowerStacksAppInventory_CL — installed applications
  • PowerStacksDriverInventory_CL — installed and optional drivers (Windows only)

For the full field-by-field schemas, see the scripts in the Windows-Enhanced-Inventory and Mac-Enhanced-Inventory repositories.