Have you ever wanted to get a quick overview of issues or errors or remediations occurring in your Intune Proactive remediations scripts?
I wrote a script that will gather this info for you and generate an HTML report. You can optionally send the report by email and even set up automation to send it out regularly (you’d need to rework the authentication part for that though).
The script runs an export job from Microsoft Graph for the PR script you specify, filters out and summaries the issues and errors, then presents it in HTML format. It includes a summary for the different output types, such as pre and post remediation detection script errors and outputs, remediation script error details and failed detections or remediations. Optionally you can include a breakdown of which devices are affected by which issues or errors, and which devices have attempted remediation.
You can use it to see if any of your scripts are generating errors on any devices, whether terminating or non-terminating, as well as which devices are attempting remediation and whether that remediations succeeds.
A few screenshots from an example report:
You can find the script on Github: https://github.com/SMSAgentSoftware/MEM/blob/main/New-ProactiveRemediationsIssuesReport.ps1
To run the script you need to have the Microsoft.Graph.Intune module installed, authenticate interactively and it’s assumed you have the appropriate permissions to Microsoft Graph.
As the script can email the report, you may wish to add the email parameter values (To, From etc) in the function itself as defaults so you don’t have to manually provide the values each time.
A few examples of how to use it:
Generate an HTML report for the specified PR script:
New-ProactiveRemediationsIssuesReport -ProactiveRemedationsScriptName "My PR Script" -HTMLReport
Generate an HTML Report for the specified PR script, send it also by email, and include the device list:
New-ProactiveRemediationsIssuesReport -ProactiveRemedationsScriptName "My PR Script" -IncludeDevices -HTMLReport -SendEmail
Generate an HTML report for the specified PR script, send it by email to the specified recipient:
New-ProactiveRemediationsIssuesReport -ProactiveRemedationsScriptName "My PR Script" -SendEMail -To "email@example.com"