Forum Discussion
Intune remediation scripts, schedule detect scripts
hi namikou1610 It’s confusing, but your reading is basically correct: in Intune Remediations, the detection script is the thing that runs on the schedule, and if it returns an issue, the remediation script runs right after it. The “every 24 hours” wording in older docs/log examples tends to describe the IME service check-in behavior, not a hard rule that every remediation package always evaluates only once per day. Microsoft’s Remediations documentation says you can set a schedule for the script package, including recurring options.
So in practice:
Detection does not have its own separate schedule from remediation.
The package schedule controls when the detect/remediate cycle is triggered.
If your logs show multiple executions inside 24 hours, that’s usually because the IME service is polling regularly and the package is being reevaluated based on assignment / policy refresh behavior, not because Intune gives you a true “run detect only every 180 days” guarantee. That distinction is subtle, and honestly the docs are not very clear about it.
A couple of practical points:
Setting Daily + repeat every 180 days is awkward because “Daily” and “180 days” are fighting each other conceptually.
If you really want very infrequent health checks, Intune Remediations is usually not the best fit for heavyweight commands like dism /scanhealth.
A more reliable pattern is to make the script self-throttling: write a local timestamp/registry value/file after a successful run, and have the detection script exit immediately unless 180 days have passed.
So the logic would be:
Intune may invoke the package more often than you want.
Your script checks “last run date.”
If it hasn’t been 180 days, exit cleanly.
Only run dism when the interval has actually elapsed.
That gives you predictable behavior even if IME evaluates the assignment more often than expected.
One more thing: I’d also double-check the remediation command. Normally you’d expect:
Detection: dism /online /cleanup-image /scanhealth
Remediation: dism /online /cleanup-image /restorehealth
Running scanhealth again in remediation won’t actually repair anything.
So my honest take: your expectation is reasonable, but Intune Remediations isn’t designed as a precise long-interval scheduler. For a 180-day cadence, script-side throttling is usually the safest workaround.