Imports managed devices, detected applications, Windows health attestation, Microsoft Defender Antivirus state and compliance and configuration results per setting from Microsoft Intune through Microsoft Graph.
For the general flow of adding a source, see Connect Data Sources.
To configure the data source, you can use your M365 interface or use the full PowerShell script that we provide.
Active Microsoft Entra ID tenant
Active Intune license
Azure account with Global Administrator or Privileged Role Administrator role ā an Application Administrator can create the App Registration but cannot grant admin consent to Microsoft Graph application permissions
Azure portal ā App registrations ā New registration
Name: HARVEN-Intune, type: Single tenant
Note the Application (client) ID and Directory (tenant) ID
API permissions ā Add a permission ā Microsoft Graph ā Application permissions
Permission | Purpose |
|---|---|
DeviceManagementManagedDevices.Read.All | Read managed devices and detected applications |
DeviceManagementConfiguration.Read.All | Read compliance policies and configuration profiles |
ā ļø Click Grant admin consent.
Certificates & secrets ā New client secret ā copy the value immediately.
Field | Where to find it |
|---|---|
Tenant ID | App Registration ā Directory (tenant) ID |
Client ID | App Registration ā Application (client) ID |
Client Secret | Certificates & secrets ā Value |
managed_devices ā Intune managed devices: Identification (device_id, device_name, serial_number, azure_ad_device_id), User (user_id, user_principal_name, user_display_name), System (operating_system, os_version, device_type), Security (compliance_state, is_encrypted, is_jail_broken, partner_reported_threat_state), Management (owner_type, enrollment_type, management_state, last_sync_datetime, enrolled_datetime), Hardware (manufacturer, model)
detected_apps ā Software inventory detected by Intune across managed devices, by application and version: Application (app_id, display_name, version, publisher, platform), Spread (device_count, size_in_bytes)
device_health_attestation ā Windows health attestation, read from an Intune report (about 10 s per query): Boot integrity (secure_boot_enabled, bitlocker_enabled, code_integrity_enabled), Last attestation (attestation_error, health_cert_issued_at)
windows_protection_state ā Microsoft Defender Antivirus state, read from an Intune report (about 7 s per query): Protection (real_time_protection_enabled, signature_update_overdue, quick_scan_overdue), Defender status flags (product_status)
compliance_setting_summaries ā Device counts per compliance setting: Setting (setting, platform), Counts (compliant_device_count, non_compliant_device_count, error_device_count)
compliance_setting_states ā Compliance state of each device for one setting (a setting filter is required): State (setting, device_id, state)
configuration_setting_summaries ā Device counts per configuration profile setting: Setting (profile_name, setting_name, instance_path), Counts (compliant_device_count, error_device_count, conflict_device_count)
device_health_attestation and windows_protection_state are read from an Intune report: each query takes several seconds, whatever its filter. On a tenant where no device has ever attested, Intune never finishes the attestation report and the query fails after two minutes.
compliance_setting_states needs a filter on setting, with a value taken from compliance_setting_summaries.setting. The three compliance and configuration tables cover classic compliance policies and configuration profiles: Settings Catalog policies and security baselines are not read.
A data source connected before a table was added gets it when you click Refresh tables on that data source.
Create the App Registration, assign the permissions and generate the secret in one command, with our PowerShell script.
How to run it:
Windows ā Right-click the file, Run with PowerShell ā or in a terminal:
powershell -ExecutionPolicy Bypass -File .\setup-microsoft-connector.ps1macOS / Linux ā Install PowerShell 7 then run the script:
brew install powershell
pwsh ./setup-microsoft-connector.ps1Arguments (optional) ā Without any argument, the script is fully interactive.
-Connector <entraid|intune|defender|mdca|azure> ā Connector to configure. Omitted: the script asks in a menu.
-AppName <name> ā Name of the App Registration to create (default: HARVEN-<connector>).
-SubscriptionId <id> ā Required for azure: target subscription for the Reader role.
-IncludeEntraIdWrite ā entraid only: adds the remediation permission User.EnableDisableAccount.All.
-Yes ā Non-interactive: skips confirmations and installs missing modules automatically.
The script offers to install the missing modules automatically.
Need help? Contact [email protected].