Skip to main content
    All posts
    Intune
    Autopilot
    Exit Codes
    Reboot
    MSI

    Exit Code 1641 and the Autopilot ESP: Why a Hard Reboot Derails Provisioning

    Andrew MartyNovember 3, 20266 min read

    Autopilot provisioning that restarts mid-way, loops, or times out on the Enrollment Status Page is often an exit code problem. When a Win32 app returns 1641 during the Enrollment Status Page (ESP), Intune treats it as a hard reboot: the installer says it already started the restart. A wrapped EXE can produce that code, or an unexpected one, from a bootstrapper you do not control. The fix is to make every app return 0 or 3010 and let Intune schedule the restart.

    Fast Verdict Matrix

    BehaviorLegacy EXE BehaviorMSI Behavior
    Reboot signal during ESPVendor-defined. May restart the machine itself or return a non-standard code.Standard: 0 or 3010 (restart needed, not started).
    Who controls restart timingThe installer, sometimes the wrapper script.Intune, through the app restart behavior setting and the ESP.
    Behavior on an unknown exit codeReported as failed, which can fail the ESP for a required app.Codes are documented and map cleanly to Intune return code types.
    Predictability across a fleetVaries per vendor and per version.Same Windows Installer contract every time.

    The Rule of Thumb

    • During ESP, signal a reboot; never perform one. Return 3010 and let Intune handle the restart at a safe point.
    • Audit the return codes of every blocking app. Any code that is not in the app's return code list is treated as a failure, and a failed blocking app can stop provisioning.

    The Fix: One Predictable Reboot Contract

    Teams usually handle this with a PowerShell wrapper such as PSAppDeployToolkit that translates vendor codes into 3010 and suppresses restarts. That works until a vendor changes behavior and the translation table is wrong in the middle of a rollout.

    InstallMage converts the EXE into a native MSI, so reboot behavior comes from Windows Installer: a pending restart is reported as 3010, and the package does not restart the device on its own. No wrapper script and no code translation table to maintain. For the comparison, see PSAppDeployToolkit vs InstallMage.

    Deep Dive

    How Intune Classifies Return Codes

    Each Win32 app has a return code list. The defaults are 0 and 1707 as success, 3010 as soft reboot, 1641 as hard reboot, and 1618 as retry. A soft reboot means the app installed and a restart is needed later. A hard reboot means the restart is happening now. Anything outside the list is a failure. You can review the full table in the Win32 exit code reference.

    What Goes Wrong During ESP

    The ESP tracks blocking apps in order and expects the device to keep progressing. A mid-phase restart interrupts that sequence, and an app that fails or times out on the device phase can show the "something went wrong" screen. Common triggers are installers that call their own restart, bootstrappers that chain redistributables and return the last child's code, and wrappers that forward a raw vendor code. Identify the code actually returned in the IME log:

    Select-String -Path "C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.log" `
      -Pattern "exit code|ExitCode|Reboot" | Select-Object -Last 20

    If the code is not 0, 1707 or 3010, add a mapping only after confirming what it means for that installer. Mapping an unknown failure to success hides a broken install.

    Keeping the MSI Quiet

    For a native MSI, make the intent explicit in the install command so no policy or property can trigger a restart:

    msiexec /i "App.msi" /qn /norestart /l*v "%TEMP%\App-install.log"

    With /norestart, Windows Installer reports 3010 when a restart is pending and does not restart. In the verbose log, look for Reboot required style entries and the final Return value. This is the same mechanism covered in the 3010 vs 1641 guide, applied to provisioning.

    Frequently Asked Questions

    Why does exit code 1641 cause problems during Autopilot ESP?

    1641 means the installer has initiated a restart. During ESP that interrupts provisioning mid-phase. Returning 3010 instead lets Intune defer the restart to a controlled point.

    Should I add 1641 as a success code in Intune?

    Only if you accept that the device restarts immediately. The default is hard reboot, which is correct for that meaning. The better fix is to stop the installer from restarting and return 3010.

    How do I get predictable reboot behavior without PowerShell wrappers?

    Deploy a native MSI. InstallMage converts EXE installers into MSI packages that follow the Windows Installer contract, so restart needs are reported as 3010 and Intune decides when to restart.


    Provisioning stays stable when apps report a restart instead of performing one. Standardize the exit codes and the Enrollment Status Page stops being the place where installer quirks surface.

    Keep reading