Proactive Remediation scripts: Export Device status report to Excel with PowerShell and Graph
In this post I will show you how to create an Excel report of your Proactive Remediation scripts device status.
Context
- You have created some Proactive Remediation scripts in Intune
- You want to list device status detailed in an Excel file
- In the device status part, it would be userful to have a Export button
- This could like for Group Policy part, as below:
The uservoice
Two weeks ago I created a uservoice for this, see here.
Hoping this will soon be available.
Get the script
You can download the script from GitHub by clicking on the below picture.
How it works ?
This will use PowerShell and MS Graph.
You can find in my previous post, how to manage Proactive Remediation scripts with Graph.
As mentioned in this post, tje resource to use is deviceHealthScripts.
In this script we will display infos of a specific script using its id.
For this we will add the resource deviceRunStates.
How to use it ?
1. The PS1 to use is Export_ProactiveRemediation_CSV.ps1
2. You will first have to connect to MSGraph with: Connect-msgraph
3. Run Export_ProactiveRemediation_CSV.ps1 with parameters below:
- Script_name: Name of your proactive remediation script
- Export_Path: Path whee to save the Excel report
Note: the script name could be just a part of the proactive remediation name.
Export in action
See below the device status from the portal for my proactive remediation script:
See below the Excel report:
2 commentaires
Your script needs some updates, if you have more than 1000 devices, it doesn't work correctly.
can you update your script to list all records, not only 1000
Enregistrer un commentaire