The entire remediation contract fits in one rule — detection exit 0 means compliant — but the edge cases around it cause most authoring mistakes. This guide explains the contract precisely, the output limits, and the testing discipline that keeps scripts honest.
This guide walks through detection script vs remediation script: exit codes explained from first principles: what actually matters, what the incumbents get wrong, and how to set it up in Intune Easy Deploy Pro without a developer. Every claim about competitor pricing or limits below reflects the 2026 audit snapshot cited in our comparison hub — verify current numbers on the vendor's own pricing page before you sign anything.
The detection script's only job is to answer 'is this device broken': exit 0 means no, anything else means yes and triggers remediation.
The detection script's only job is to answer 'is this device broken': exit 0 means no, anything else means yes and triggers remediation. In practice, this is where most teams either win or quietly lose: the difference between a tool that earns its place in the workflow and one that gets quietly abandoned after the trial comes down to how deliberately each of these decisions is made.
The entire remediation contract fits in one rule — detection exit 0 means compliant — but the edge cases around it cause most authoring mistakes. This guide explains the contract precisely, the output limits, and the testing discipline that keeps scripts honest. With Intune Easy Deploy Pro, this is handled inside the normal workflow rather than bolted on afterward — configure it once in the workspace, preview the result live, and the telemetry tells you whether it is working. The sections below break the decision into checkable steps.
The remediation script's job is to fix it and should be idempotent — running it twice must be as safe as running it once.
The remediation script's job is to fix it and should be idempotent — running it twice must be as safe as running it once. In practice, this is where most teams either win or quietly lose: the difference between a tool that earns its place in the workflow and one that gets quietly abandoned after the trial comes down to how deliberately each of these decisions is made.
The entire remediation contract fits in one rule — detection exit 0 means compliant — but the edge cases around it cause most authoring mistakes. This guide explains the contract precisely, the output limits, and the testing discipline that keeps scripts honest. With Intune Easy Deploy Pro, this is handled inside the normal workflow rather than bolted on afterward — configure it once in the workspace, preview the result live, and the telemetry tells you whether it is working. The sections below break the decision into checkable steps.
Script output is capped at 2,048 characters in Intune; log the summary to output and offload full logs elsewhere for diagnosis.
Script output is capped at 2,048 characters in Intune; log the summary to output and offload full logs elsewhere for diagnosis. In practice, this is where most teams either win or quietly lose: the difference between a tool that earns its place in the workflow and one that gets quietly abandoned after the trial comes down to how deliberately each of these decisions is made.
The entire remediation contract fits in one rule — detection exit 0 means compliant — but the edge cases around it cause most authoring mistakes. This guide explains the contract precisely, the output limits, and the testing discipline that keeps scripts honest. With Intune Easy Deploy Pro, this is handled inside the normal workflow rather than bolted on afterward — configure it once in the workspace, preview the result live, and the telemetry tells you whether it is working. The sections below break the decision into checkable steps.
Scripts run 32-bit PowerShell by default — registry and file-system redirection can make a correct-looking script check the wrong location.
Scripts run 32-bit PowerShell by default — registry and file-system redirection can make a correct-looking script check the wrong location. In practice, this is where most teams either win or quietly lose: the difference between a tool that earns its place in the workflow and one that gets quietly abandoned after the trial comes down to how deliberately each of these decisions is made.
The entire remediation contract fits in one rule — detection exit 0 means compliant — but the edge cases around it cause most authoring mistakes. This guide explains the contract precisely, the output limits, and the testing discipline that keeps scripts honest. With Intune Easy Deploy Pro, this is handled inside the normal workflow rather than bolted on afterward — configure it once in the workspace, preview the result live, and the telemetry tells you whether it is working. The sections below break the decision into checkable steps.
Test both scripts against four states: healthy device, broken device, already-remediated device, and a device where remediation is impossible.
Test both scripts against four states: healthy device, broken device, already-remediated device, and a device where remediation is impossible. In practice, this is where most teams either win or quietly lose: the difference between a tool that earns its place in the workflow and one that gets quietly abandoned after the trial comes down to how deliberately each of these decisions is made.
The entire remediation contract fits in one rule — detection exit 0 means compliant — but the edge cases around it cause most authoring mistakes. This guide explains the contract precisely, the output limits, and the testing discipline that keeps scripts honest. With Intune Easy Deploy Pro, this is handled inside the normal workflow rather than bolted on afterward — configure it once in the workspace, preview the result live, and the telemetry tells you whether it is working. The sections below break the decision into checkable steps.
Frequently asked questions
What should the detection script return?
Exit code 0 when the device is compliant (nothing to fix), non-zero when the problem exists. Keep the logic to a single clear question per script.
Why 32-bit PowerShell matters?
File system and registry redirection mean HKLM\Software or System32 paths may resolve differently than in 64-bit. Either write bitness-aware code or set the execution context explicitly.
How much can the script output?
2,048 characters through Intune's native reporting. Put the verdict in the output and offload detailed logs to a storage location for troubleshooting.
Should remediation scripts be idempotent?
Yes — a remediation may run more than once against the same device. Design every action so re-running it on an already-fixed device is harmless.