Headless export now fetches objects 20 per $batch call (was one call per object because UseBatchAPI defaulted to off). -NoBatchApi on Export-Policies.ps1 / Start-HeadlessIntune.ps1 falls back to single calls. Adds per-run setting overrides ($global:SettingOverrides, consulted by Get-SettingValue, set by Invoke-IntuneHeadlessBatch and never persisted). Verify on a tenant by exporting with and without -NoBatchApi and comparing the two folders with Compare-Tenants.py.
Headless Runtime
This folder contains the reusable CLI module for the repo.
Module
Exported commands
Get-DefaultIntunePolicyObjectTypesExport-IntunePoliciesImport-IntunePoliciesInvoke-IntunePolicyAction
Example
Import-Module ./Headless/IntuneManagement.Headless.psd1
Export-IntunePolicies `
-TenantId "<source-tenant-id>" `
-AppId "<app-id>" `
-Secret "<client-secret>" `
-ExportPath "/tmp/intune-export"
Export-IntunePolicies `
-TenantId "<source-tenant-id>" `
-AuthMode Browser `
-RedirectUri "http://localhost" `
-ExportPath "/tmp/intune-export"