We value your privacy

We use cookies to analyze site traffic and improve your experience. You can accept all cookies or reject non-essential ones. See our Privacy Policy for details.

GR IT SERVICES
  • Contact
Get a quote
  1. Microsoft Intune
  2. Remediations
Intune remediations

One exit code decides whether Intune fixes the problem or does nothing at all.

A remediation package pairs a detection script with a fix script, and the fix fires only when detection returns exit code 1. Add the documented reporting rhythm, where a recurring script stays silent for up to six days when nothing changes, and you have a feature that gets misdiagnosed as broken more often than it actually breaks. We design packages around both rules so your automation earns trust instead of tickets.

Book a remediations design sessionSee how they work
Intune remediations for US organizations
  • 200Script package ceiling per tenant
  • 8 hoursPolicy pickup cadence, unchangeable
  • 2,048Character cap on script output
  • exit 1The only signal that triggers a fix
The mechanism in brief

Everything hangs on how the detection script exits.

Understand the exit code contract and half of the troubleshooting guides become unnecessary. Miss it and your first package will look inert.

  • A package bundles two PowerShell scripts with metadata. The first script tests for the condition. The second corrects it. They communicate through exactly one channel: the exit code of the first.
  • Exit code 1 from detection means the condition exists and the remediation should run. Every other outcome, including a script that writes a detailed description of the problem to output but exits 0, tells Intune there is nothing to fix.
  • Microsoft draws three bright lines around script content: keep reboot commands out of both scripts, keep passwords and other sensitive values out, and never use the scripts to gather personal data from devices.
  • File handling has its own trap. Scripts must be UTF-8, and UTF-8 without a byte order mark wherever signature checking is enforced. Since most editors hide the BOM distinction entirely, uploading a saved file beats pasting text every time.
What remediations do

Eight documented rules that separate reliable automation from surprise outages.

Every remediation is code executing without supervision on every device you assign it to, on a repeating schedule. Microsoft publishes the guardrails plainly. Reading them before the first deployment is cheaper than discovering them through a support queue.

A pair of scripts with a strict contract between them

The package format is detection script plus remediation script plus metadata. Detection answers one question: is the condition present. If it signals yes by exiting with code 1, the remediation executes. Exit zero, any other code, or even empty output all count as condition absent, and the fix stays dormant no matter what the script printed along the way.

Reporting that goes silent on purpose

For recurring scripts, Microsoft documents a seven day cycle: during the first six days the client only sends results when something changed, with the first execution counting as a change, then on day seven it reports unconditionally. A console showing nothing new is usually describing a stable estate, not a stalled one.

An 8 hour retrieval clock you cannot reset

Devices pick up remediation policy at three moments: when the device or the Intune management extension restarts, when a user signs in, and on a fixed 8 hour cycle anchored to when the management extension service started. Signing in again does not move that clock, so a fresh assignment can sit unexecuted for hours without anything being wrong.

Three schedule types and one hard boundary

You can run a package once at a set time, hourly at an interval that must stay under 24 hours, or daily. Execution follows the device's local clock unless you select the Use UTC option, and a device that was offline at its slot runs the package as soon as it reconnects. With staff scattered across US time zones, the local-versus-UTC choice deserves a deliberate answer.

An encoding requirement with no error message

Script files must be UTF-8, and when Enforce script signature check is turned on they must be UTF-8 without a byte order mark. Microsoft's guidance is to upload the file instead of pasting the contents into the browser, because pasting is where the encoding quietly goes wrong and a mis-encoded script simply never behaves.

Signature enforcement swaps the execution policy underneath you

Turn signature checking on and your script is subject to the device's own PowerShell execution policy, Restricted by default on Windows clients and RemoteSigned on Windows Server. Leave it off and scripts execute under Bypass. The built-in packages ship signed, with the signing certificate placed in the device's Trusted Publishers store.

A 2,048 character ceiling and three explicit prohibitions

Output above 2,048 characters is lost, so chatty scripts destroy their own evidence trail. Microsoft also instructs plainly: no reboot commands inside either script, no passwords or other sensitive values, and no collecting personal data from devices. For a HIPAA covered entity or a business subject to a state privacy statute, that third rule is what keeps regulated data out of your admin console.

A single-device trigger for the service desk, still in preview

Run remediation on demand pushes an existing package to one Windows device immediately, provided the caller holds the Run remediation permission under remote tasks and the device can reach Intune and the push notification service. One action per device at a time is the limit; firing several in rapid sequence risks them overwriting each other.

The trap in the timeline

Silence for six days is the documented behavior, not a defect.

Two separate clocks govern this feature, and conflating them is how healthy deployments get torn down and rebuilt for no reason.

  • The reporting clock: a run-once script reports when it finishes, but a recurring script reports on change only for six days, counting its first execution as a change, and then unconditionally on the seventh. A device that was fixed on day one contributes nothing new until the weekly report lands.
  • What that means in the console: remediated, stable devices drop out of recent results by design. Interpreting that gap as an agent problem, and editing or reassigning the package in response, resets your evidence and teaches the team to distrust a tool that was working.
  • The retrieval clock: policy reaches devices on restart of the device or management extension, on user sign-in, and every 8 hours on a schedule pinned to the management extension service start. Sign-ins never shorten the 8 hour interval.
  • Put the two clocks together and the minimum honest pilot length writes itself. Allow up to 8 hours for pickup, then a full seven days for the reporting cycle to complete. Judging results on day three means judging a report that has not happened yet.
Ask us to design the schedule properly
How we approach it

Four disciplines for code nobody watches while it runs.

Estate-wide, repeating, unsupervised execution is a different risk category from a technician running a script by hand. Our whole method comes from respecting that difference.

Detection accuracy outranks remediation ambition

Since exit code 1 is the sole trigger, a loose detection script does damage in both directions: it can push a fix onto healthy machines or leave broken ones untouched while reporting green. We spend more review time on the detection logic than the fix, because that is where a package earns or loses its credibility.

Pilots run the full seven days, without exception

The documented cycle sends unconditional reports only on day seven, with change-only reporting before that. Evaluating earlier means acting on an incomplete picture, and the usual reaction, rewriting a script that was fine, destroys the baseline you were trying to build. We let the cycle finish before anyone passes judgment.

Every fix is built for its second run

Custom packages repeat every 24 hours and detection fires on whatever schedule you set, so the same remediation will execute against the same machine again. We write fixes that converge on the correct state rather than perform an action, and the documented ban on reboot commands closes off the lazy path for anything restart-shaped.

Files travel by upload, never by clipboard

Microsoft points at browser editing as the way encoding gets corrupted, and the requirement is strict: UTF-8, and BOM-free wherever signature checks apply. A wrong encoding produces no error, no log entry, just a package that never seems to do anything. Uploading a verified file removes that entire failure class.

How an engagement runs

Four phases over roughly four to five weeks.

One phase is longer than instinct says it should be. The seven day reporting cycle sets a floor under pilot duration that no amount of eagerness can lower.
  1. 01
    Week 1

    Qualify the estate, then qualify the problems

    Eligibility first: Entra joined or hybrid joined devices, MDM enrolled on Windows Enterprise, Professional or Education, or co-managed, with qualifying licenses confirmed by an Intune Service Administrator before first use. Then the question that determines value: which of your repeat tickets can a script both detect and repair.

    • Join state and Windows edition coverage mapped
    • License qualification confirmed ahead of first use
    • Repeat ticket themes ranked as automation candidates
    • The two built-in packages evaluated for early wins
  2. 02
    Week 2

    Build the scripts against the published rules

    Detection returns exit 1 in exactly one circumstance: the condition genuinely present. Remediation is written to run twice without harm, carries no reboot, no credentials and no personal data, and keeps its output inside the 2,048 character ceiling.

    • Detection conditions and exit paths reviewed
    • Remediation logic proven safe on repeat execution
    • Output format designed for the character ceiling
    • Files saved UTF-8 and delivered by upload, never paste
  3. 03
    Weeks 3-4

    Run the pilot long enough to mean something

    A controlled device group, a recorded schedule and UTC decision, and then a full seven days untouched, because the reporting cycle only sends unconditional results on day seven. Cutting this short yields data that indicts nothing except the calendar.

    • Pilot group assigned and left undisturbed
    • Schedule and time zone choices written down
    • Full reporting cycle observed end to end
    • CSV export pulled and detection accuracy reviewed
  4. 04
    Week 5

    Go wide and install the maintenance habit

    Production assignment, on-demand run permissions issued to the service desk roles that will use them, and a standing review that removes packages once their underlying cause is cured, keeping the tenant well clear of the 200 package ceiling.

    • Estate-wide assignment completed
    • Service desk permissions for on-demand runs in place
    • Retirement review scheduled on a recurring basis
    • Operations notes covering both documented clocks
Where this pays off

Six recurring problems worth automating away.

The qualifying test is simple: does the issue repeat, can a script see it, and can a script correct it without restarting the machine. Microsoft's own built-in packages model the pattern.

Group Policy gone stale on far-flung machines

Microsoft ships Update stale Group Policies as a ready-made package, noting that stale policy shows up at the helpdesk as connectivity and internal resource access complaints. Because it only needs an assignment, it doubles as a safe first exercise for a team getting comfortable with the mechanism.

Office refusing to launch because a service died

The second built-in package restarts the Office Click-to-run service, the failure behind a familiar class of calls where Office applications simply will not open. Both built-ins arrive signed with the certificate in the Trusted Publishers store, so they work even where signature enforcement is on.

A hardening setting that will not stay put

When a legacy application or a user keeps undoing a security configuration, a detect-and-correct package reasserts it on schedule. Frameworks like NIST CSF and SOC 2 would call that a compensating control, and it should be documented as one, but it holds the line while the root cause gets engineered out.

Endpoints where sending a person is the expensive part

Warehouse floors, branch offices, field equipment: the ticket cost is dominated by travel or coordinating remote hands. A package that catches and corrects the routine failure before it surfaces converts the priciest ticket category into a non-event, which is where multi-site US operators see the fastest payback.

Proving a control operated, not just that it existed

Per-device results with CSV export show that a defined condition was evaluated across the estate and corrected wherever found. When a SOC 2 auditor, a HIPAA risk analysis or an FTC Safeguards assessment asks for operating evidence rather than policy text, that export is precisely the artifact they mean.

Giving the service desk a one-click known-good repair

With on-demand runs, an agent can push a vetted package at the caller's machine mid-conversation, in preview, so long as the device is online and reachable through Intune and the notification service. A scripted repair replaces a quarter hour of guided clicking with a single action.

Three positions

What happens to a repeat endpoint issue in most US companies.

Column three is where most estates sit today. Nobody budgets for it because the cost arrives as scattered technician minutes rather than a line item.
Issue corrected before anyone files a ticket
Remediations, designedOften
Ad hoc scriptsNo
Fixed by the service deskNo
Test-for-problem separated from apply-the-fix
Remediations, designedYes
Ad hoc scriptsRarely
Fixed by the service deskNot applicable
Executes on a defined schedule
Remediations, designedOnce, hourly or daily
Ad hoc scriptsWhen someone runs it
Fixed by the service deskOn a ticket
Effectiveness visible afterward
Remediations, designedPer device status plus CSV export
Ad hoc scriptsNone
Fixed by the service deskTicket counts
Written for repeat execution
Remediations, designedBy design
Ad hoc scriptsUnknown
Fixed by the service deskNot applicable
Can be fired at one device on request
Remediations, designedYes, in preview
Ad hoc scriptsYes
Fixed by the service deskYes
Identical behavior across the estate
Remediations, designedYes
Ad hoc scriptsNo
Fixed by the service deskNo
Staff time consumed per occurrence
Remediations, designedNone
Ad hoc scriptsSome
Fixed by the service deskA full ticket
Leaves an audit trail
Remediations, designedYes
Ad hoc scriptsNo
Fixed by the service deskPartly
Holds up as the device count grows
Remediations, designedYes
Ad hoc scriptsNo
Fixed by the service deskNo
Feature
Remediations, designed
Ad hoc scripts
Fixed by the service desk
Issue corrected before anyone files a ticket
OftenNoNo
Test-for-problem separated from apply-the-fix
YesRarelyNot applicable
Executes on a defined schedule
Once, hourly or dailyWhen someone runs itOn a ticket
Effectiveness visible afterward
Per device status plus CSV exportNoneTicket counts
Written for repeat execution
By designUnknownNot applicable
Can be fired at one device on request
Yes, in previewYesYes
Identical behavior across the estate
YesNoNo
Staff time consumed per occurrence
NoneSomeA full ticket
Leaves an audit trail
YesNoPartly
Holds up as the device count grows
YesNoNo
The published limits

The constraint sheet we check every package against.

All of these come straight from the documentation. None of them announce themselves when violated, which is exactly why they belong on one page.

Constraint

Script packages per tenant

The rule
200 maximum

Constraint

What triggers the remediation script

The rule
Detection exiting with code 1, nothing else

Constraint

Every other exit result

The rule
Read as condition not found, empty output included

Constraint

File encoding

The rule
UTF-8; no byte order mark when signature check is on

Constraint

Script output ceiling

The rule
2,048 characters

Constraint

Hourly interval bound

The rule
Under 24 hours, always

Constraint

Custom package repeat rate

The rule
Once per 24 hours

Constraint

When devices fetch policy

The rule
Restart, user sign-in, and a fixed 8 hour cycle

Constraint

Reboots inside scripts

The rule
Prohibited by Microsoft guidance

Constraint

Assignment group hygiene

The rule
Never mix user and device groups between include and exclude
ConstraintThe rule
Script packages per tenant200 maximum
What triggers the remediation scriptDetection exiting with code 1, nothing else
Every other exit resultRead as condition not found, empty output included
File encodingUTF-8; no byte order mark when signature check is on
Script output ceiling2,048 characters
Hourly interval boundUnder 24 hours, always
Custom package repeat rateOnce per 24 hours
When devices fetch policyRestart, user sign-in, and a fixed 8 hour cycle
Reboots inside scriptsProhibited by Microsoft guidance
Assignment group hygieneNever mix user and device groups between include and exclude
How an engagement runs

Five steps, starting from your service desk history.

We do not arrive with a script library looking for problems. Your ticket queue already ranks the problems by frequency; the engagement turns the top of that ranking into packages.
  1. 1

    Verify eligibility and licensing

    Confirm devices are Entra joined or hybrid joined, MDM enrolled on Windows Enterprise, Professional or Education, or co-managed. Confirm license coverage via Windows Enterprise E3 or E5, Education A3 or A5, or Virtual Desktop Access per user, with an Intune Service Administrator signing off before first use as Microsoft requires.

  2. 2

    Mine the ticket history for candidates

    Pull the themes that recur, then filter hard: detectable by script, correctable by script, no restart required. Assigning one of the two built-in packages early proves the pipeline works in your tenant while the custom candidates are still being shortlisted.

  3. 3

    Author and review the packages

    Detection that exits 1 solely on a genuine hit. Remediation that is safe to repeat. Output under 2,048 characters, zero reboot commands, zero credentials, zero personal data. UTF-8 files, uploaded rather than pasted, per Microsoft's own recommendation.

  4. 4

    Pilot through one complete reporting cycle

    A small device group, the schedule and UTC decision on record, and seven undisturbed days so the unconditional day-seven report arrives. Then the CSV export gets read closely, because inaccurate detection shows up there before it shows up anywhere else.

  5. 5

    Scale out and keep the list honest

    Broad assignment, on-demand permissions for the service desk where wanted, and a recurring cull of packages whose underlying problem no longer exists, so the tenant is not creeping toward the 200 package ceiling under the weight of forgotten automation.

Straight answers

The questions US teams bring us about remediations.

Probably the opposite. The documented behavior for recurring scripts is a seven day cycle: reports are sent only when results change during the first six days, with the initial run counting as a change, and an unconditional report follows on day seven. Stable, remediated devices produce no news between those points, which is the system working.

Devices collect remediation policy at three moments only: a restart of the device or the Intune management extension, a user sign-in, and a fixed 8 hour cycle anchored to when the management extension service started. Because sign-ins do not reset that cycle, a delay of several hours between assignment and first execution is entirely normal.

Check what the detection script exits with. The remediation executes on exit code 1 and nothing else. Scripts that print a finding and then exit 0, or exit without setting a code, or produce empty output, all register as condition absent. First-time authors hit this constantly because the output looks right while the exit code says otherwise.

Yes, same feature, shorter name. It now lives under Devices, Manage devices, Scripts and remediations in the Intune admin center. Older blog posts and forum threads still use the previous name, so searching with both terms finds more answers.

Device users need one of: Windows Enterprise E3 or E5, which Microsoft 365 F3, E3 and E5 include; Windows Education A3 or A5, included in Microsoft 365 A3 and A5; or Windows Virtual Desktop Access per user. Microsoft additionally requires an Intune Service Administrator to confirm the licensing position before the feature is used for the first time.

No. Microsoft's guidance says directly not to place reboot commands in detection or remediation scripts. The workable pattern is to have the remediation stage the correct state and let your established update or restart notification process handle the reboot itself.

You are over the output ceiling, which is 2,048 characters. Anything beyond it is discarded, so verbose progress logging costs you the very diagnostics it was meant to provide. Structure output tersely, especially for packages whose CSV exports you plan to analyze later.

Microsoft's documented recommendation is No, and the mechanics explain why. Enforcement makes the script subject to the device's execution policy, Restricted by default on Windows clients and RemoteSigned on servers, while leaving it off runs scripts under Bypass. Whichever way you decide, decide it knowingly, because it changes what will and will not execute.

Yes, through the on-demand capability, currently in preview and limited to one Windows device per action. Requirements: the Run remediation permission under remote tasks, a device that is online and reachable through Intune and the Windows Push Notification Service, and the Intune Management Extension present, which arrives automatically once any Win32 app, script or remediation has been assigned. Issue one action and wait; stacking several against the same device risks them overwriting each other.

Both work, with one documented rule to respect: never mix user groups and device groups between the include and exclude sides of an assignment. Where you need to narrow scope, filters usually do it more cleanly than minting another group.

It must not, and Microsoft's guidance aligns with your compliance interest: no sensitive information such as passwords in scripts, and no using scripts to harvest personal data from devices. Whatever a script outputs becomes visible in results tables and CSV exports, so we author detection to evaluate conditions and return status, never content. Your compliance advisors get a data path they can sign off on.

Scoped per engagement, driven by how many packages you need and the validation depth each one warrants. Before any of that, here is the free qualifying exercise: pull ninety days of tickets, rank the repeat offenders, and ask which of the top three a script could detect and fix without a reboot. If one qualifies, the engagement has its first candidate.
Before you deploy a script

Fifteen questions to answer before code ships to every device.

Unattended, repeating, estate-wide execution deserves a pre-flight routine. This is ours, built directly from the documented requirements.

Eligibility

  • Entra joined or hybrid joined, confirmed?
    A hard prerequisite either way.
  • Editions covered: Enterprise, Professional, Education?
    Or co-managed running Windows.
  • Licenses in place for the assigned users?
    Windows E3/E5, Education A3/A5, or VDA per user.
  • Licensing signed off by an Intune Service Administrator?
    Microsoft requires this before first use.
  • Package count checked against the ceiling?
    200 is the tenant maximum.

Script safety

  • Detection exits 1 only on a true positive?
    The sole trigger for remediation.
  • Remediation harmless when run twice?
    Repeat execution is guaranteed.
  • Both scripts free of reboot commands?
    Microsoft prohibits them.
  • No passwords, secrets or personal data anywhere?
    Prohibited, and a compliance exposure besides.
  • Output within the 2,048 character ceiling?
    Everything past it is discarded.

Deployment

  • Files uploaded as UTF-8 rather than pasted?
    The BOM problem hides in pasted text.
  • Signature enforcement a conscious choice?
    It swaps which execution policy applies.
  • User and device groups kept apart across include and exclude?
    Mixing them is explicitly warned against.
  • Hourly interval below 24 hours?
    The documented bound.
  • Pilot window spans a full seven days?
    Shorter windows predate the unconditional report.
Related reading

The pages around this one.

Intune endpoint analytics

Where the measurement layer lives, alongside the results your remediations feed.

Learn more

Win32 app packaging

The second surface where your own code runs on managed devices through Intune.

Learn more

Intune configuration profiles

Declarative settings delivery, worth exhausting before reaching for a script.

Learn more
Next step

Pull ninety days of tickets and rank the repeat offenders.

Any theme a script can detect and correct without a restart is a remediation candidate. The qualifying data is already sitting in your service desk, which makes this the rare automation project that starts with evidence instead of a hunch.

Book a remediations design sessionSee Microsoft Intune services

Related Services

Explore more solutions that work great with this service

Microsoft Intune

Device management and endpoint security

Learn more
GR IT SERVICES

IT services for US businesses,
delivering enterprise-grade solutions
remotely, coast to coast.

Microsoft CSP PartnerApple Jamf PartnerCISGuard

Microsoft 365

  • Microsoft 365 Administration
  • M365 Reporting & Auditing
  • Microsoft 365 Licensing
  • Microsoft Copilot
  • Microsoft 365 Apps
  • Windows 365 Cloud PC
  • Microsoft SharePoint
  • Outlook & Exchange

Security

  • Microsoft Defender
  • Microsoft Purview
  • Microsoft Intune
  • Microsoft Entra
  • Compliance Manager
  • Cybersecurity Audits
  • Copilot for Security
  • Microsoft Sentinel
  • Microsoft Priva

Infrastructure

  • Google Workspace
  • Cloud Migration Services
  • Data Analytics & BI
  • Active Directory
  • Server Management
  • Apple Business
  • Apple Jamf Pro
  • IP Telephone
  • Data Backup
  • Website Development

IT Services

  • Managed IT Services
  • IT Support USA
  • IT AMC USA
  • New Office IT Setup
  • IT Relocation
  • Remote IT Support
  • On-Call IT Support
  • Startup IT Business Kit
  • Disaster Recovery & BC

Company

  • About Us
  • Careers
  • Contact
  • Blog

Contact

  • hello@gritservices.io
  • gritservices.io

© 2026 GR IT Services. All rights reserved.

Privacy PolicyTerms of UseCookie PolicyCCPA/CPRA