5.1MD-102Intermediate
Est: ~15 minsVerified: 2026-08

Win32 App Packaging, Detection Rules & ESP Blocking

Package legacy installers into .intunewin format using IntuneWinAppUtil, author custom PowerShell detection rules, and configure Enrollment Status Page blocking.

Tags:#Win32 Apps#intunewin#Detection Rules#ESP#Packaging#MD-102
01

Overview

Win32 Application Deployment via the Intune Management Extension (IME) is the most flexible and powerful application delivery mechanism in Microsoft Intune.

Any standard .exe, .msi, .bat, or PowerShell script can be pre-processed into an encrypted, compressed .intunewin package using the Microsoft Win32 Content Prep Tool (IntuneWinAppUtil.exe). Intune handles installation commands, uninstallation strings, return codes, and executes Detection Rules to verify installation status.

---

02

When to Use

ScenarioRecommendationTechnical Rationale
Complex Installers / DependenciesUse Win32 (.intunewin)Supports multi-file directories, custom PowerShell detection scripts, and dependency chaining.
Simple Standalone MSIUse Win32 (Preferred over LOB)Modern best practice strongly recommends packaging MSIs as Win32 rather than Line-of-Business (LOB) to avoid mix-mode ESP deadlocks.
Autopilot OOBE Blocking AppsMandatory Win32Only Win32 and modern Store apps should be assigned as ESP blocking apps during Autopilot.

---

04

Portal Path

TEXT
Microsoft Intune Admin Center (https://intune.microsoft.com)
└── Apps
    └── Windows
        └── Add
            └── App type: Windows app (Win32)

---

05

Step-by-Step Implementation

Step 1: Package Source Files using IntuneWinAppUtil.exe

PowerShell
# Syntax for Win32 Content Prep Tool:
.\IntuneWinAppUtil.exe -c "C:\AppSource\7Zip" -s "7z2301-x64.msi" -o "C:\AppOutput" -q
# Generates: C:\AppOutput\7z2301-x64.intunewin

Step 2: Upload to Microsoft Intune

  1. In Intune Admin Center > Apps > Windows > Add > Windows app (Win32).
  2. Select the generated .intunewin file.
  3. Configure Program:
  • Install command: msiexec /i "7z2301-x64.msi" /qn /norestart
  • Uninstall command: msiexec /x "{23170F69-40C1-2702-2301-000001000000}" /qn
  • Install behavior: System (Installs as NT AUTHORITY\SYSTEM)
  • Device restart behavior: No specific action

Step 3: Configure Detection Rules

Choose Manually configure detection rules:

  • Rule format: File / MSI / Registry OR Custom Detection Script.
  • Example File Detection:
  • Path: C:\Program Files\7-Zip
  • File or folder: 7z.exe
  • Detection method: File or folder exists

---

06

PowerShell Custom Detection Script

PowerShell
# Custom PowerShell Detection Script Example (Must return Exit Code 0 and output text on success)
$AppPath = "C:\Program Files\ExampleApp\app.exe"
$MinVersion = [version]"2.5.0.0"

if (Test-Path $AppPath) {
    $InstalledVersion = [version](Get-Item $AppPath).VersionInfo.FileVersion
    if ($InstalledVersion -ge $MinVersion) {
        Write-Output "App detected with compliant version: $InstalledVersion"
        Exit 0 # Success: Intune considers the application INSTALLED
    }
}

# Failure: Exit with non-zero or return nothing
Write-Output "App not found or version is below baseline"
Exit 1 # Failure: Intune triggers installation

---

09

Diagnostic Logs

Log FilePathKey Search Terms
IntuneManagementExtension.logC:\ProgramData\Microsoft\IntuneManagementExtension\Logs\Search for [Win32App], ExitCode, DetectionRule, or app GUID.
AgentExecutor.logC:\ProgramData\Microsoft\IntuneManagementExtension\Logs\Contains raw standard output from PowerShell detection and requirement scripts.

---

10

Troubleshooting Matrix

Exit Code / ErrorMeaningExact Resolution
0x87D1041CApplication installed, but the Detection Rule failed to detect it post-install.Check your detection rule path, registry key, or custom script. Ensure the file actually exists where specified.
1603 (MSI Fatal Error)Generic MSI failure; common causes include insufficient permissions or reboot pending.Review vendor MSI log by adding /l*v C:\Install.log to the install command.
0x800705B4ESP Timeout during Autopilot enrollment due to slow app download or reboot hang.Remove heavy apps from ESP blocking list or switch install context to System.

---

12

MD-102 Exam Notes

Exam Blueprint & High-Yield Traps

Critical Exam Traps:

  1. Do NOT Mix LOB and Win32 Apps: Never assign both Line-of-Business (single MSI) apps and Win32 (.intunewin) apps during Autopilot ESP, as the two installer agents will conflict and cause timeout failures.
  2. Detection Script Return Codes: A custom detection script indicates success by outputting text to STDOUT and returning Exit Code 0. Any non-zero exit code indicates the app is missing.