Template scripts for Intune Proactive Remediation

Need to create an Intune Proactive Remediation and don’t want to start from scratch? These simple template scripts can be used to easily create an Intune Proactive Remediation, which reports back success or error messages to the Intune portal.

The payload of the scripts is up to you, but I have added an example which sets a registry value in the HKLM hive.

Detection script

The detection script will check if the desired registry value exists. If not, it will instruct Intune to run the remediation script.

Remediation script

The remediation script will attempt to create the desired registry value. After the remediation script has run, the detection script will run again in order to confirm the success of the remediation script.

In Intune you will now be able to monitor the success of your Proactive Remediation and see relevant error messages returned from the client. For example, as shown below where the Proactive Remediation runs the detection script, fails to detect the desired registry value and thereby triggers the remediation script.

After the remediation script has run, the detection script is run again and now successfully detects the created registry value.

Share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.