Why use this template?
Use this PowerShell template when you need to export managed device inventory from Intune. It is generated locally and can be reviewed before you run it yourself in your own PowerShell session.
The template uses Microsoft.Graph.DeviceManagement and requires DeviceManagementManagedDevices.Read.All. Output: CSV report. Level: Beginner. Action: Read-only. Risk: Low.
Review before running
The script is generated in your browser. Read it before you run it, and test it outside production first. “Read-only” describes the script itself; anything you add around it can still change data.
Generate the script
- Open the template in the PowerShell Builder.
- Enter the requested values and review the module, permissions, output and risk.
- Generate the script, read it carefully, and test it outside production before use.
The script is generated locally in your browser. Nothing needs to be uploaded to Opselith.
Generate Export Intune managed devices →How to use this result
Use this report to export the Intune managedDevice inventory returned by Microsoft Graph without changing device state.
When this helps
- Create a current managed-device inventory before an Intune review or migration project.
- Compare ownership, operating system, compliance state, last sync, Entra device ID and serial number in one CSV.
How to read the result
- Each row is an Intune managed-device record, not the Microsoft Entra device object itself.
- LastSyncDateTime is the last Intune sync value and is not the same as user sign-in activity or exact physical-device use.
Things to check
- ComplianceState is the state Intune reports at export time; investigate relevant policies before treating it as a complete compliance diagnosis.
- Duplicate, replaced or stale records need separate lifecycle review before removal.
What to do next: Filter the inventory by compliance, ownership and last sync, then use the focused stale or non-compliance reports for deeper review.
Related tasks
Official references