m.miloch.dev ← PSADT v4 — Your First PackageCourse
Lesson 6 of 630 minFree course

Handover to ConfigMgr and Intune

How a tested PSADT 4.1 package becomes a Configuration Manager application or an Intune Win32 app: command lines, deploy mode, install context, a product code detection rule, return codes, and what to check after the first deployment.

In this lesson
  • Write the install, uninstall and repair command lines for a PSADT package
  • Choose the deploy mode and install context for ConfigMgr and Intune
  • Configure an MSI product code detection rule and explain the script detection rules
  • Name the settings to verify on a ConfigMgr deployment type and an Intune Win32 app
  • Find the client logs that show the result of the first deployment

The package from lessons 4 and 5 is tested and documented. What remains is the handover: the deployment tool needs the package folder, the command lines and a rule that tells it whether the application is installed. This lesson covers that handover for Configuration Manager and for Intune at an overview level, with the settings that matter for a PSADT package. The detailed walkthroughs are linked at the end.

What is handed over

The deployment tool receives two things:

  1. The package folder, unchanged after testing. In Configuration Manager it is the content source of the deployment type. For Intune it is converted into a single .intunewin file.
  2. A handover sheet with the values the tool needs. The exercise at the end of this lesson produces one.

The package must not be edited after the tests. Any change, even a corrected comment, means a new revision and a new test cycle.

Command lines

Both tools call the launcher, not the wrapper script:

text
Install:    Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent
Uninstall:  Invoke-AppDeployToolkit.exe -DeploymentType Uninstall -DeployMode Silent
Repair:     Invoke-AppDeployToolkit.exe -DeploymentType Repair -DeployMode Silent

Calling the .exe has three effects, as described in lesson 2: it starts Windows PowerShell with -ExecutionPolicy Bypass in a hidden window, it runs the wrapper from the package folder, and it passes the wrapper's exit code back to the deployment tool.

Both parameters are optional in the 4.1.8 template. Without -DeploymentType, the wrapper runs Install; without -DeployMode, it runs in Auto mode and decides at session start (lesson 2). The command lines in this course state both values, so the handover sheet shows exactly what runs.

Warning
In an Intune command line, a direct call of powershell.exe starts 32-bit PowerShell, as the Win32 app documentation states. 64-bit PowerShell needs %SystemRoot%\Sysnative\WindowsPowerShell\v1.0\powershell.exe. The launcher avoids the question: according to its 4.1.8 project file it is an AnyCPU .NET program, so it runs as a 64-bit process on 64-bit Windows, and it starts WindowsPowerShell\v1.0\PowerShell.exe from the system directory of that process.

-ExecutionPolicy Bypass has one documented limit. According to about_Execution_Policies, an execution policy set on the command line applies to the process scope and does not take precedence over a policy set by Group Policy. If devices receive Turn on Script Execution through Group Policy, the package must meet that policy; under AllSigned, for example, the wrapper script itself needs a trusted signature. Code signing is part of the advanced course.

Which deploy mode

For a first package, -DeployMode Silent is the predictable choice in both tools:

  • Intune. Microsoft states that Intune "does not support interactive application installations" and that tools such as serviceui.exe that force interaction are unsupported. PSADT 4.1 shows dialogs from SYSTEM without ServiceUI, according to its 4.1.0 release notes, but that is not a configuration Microsoft supports for Intune. How PSADT dialogs relate to this statement, and how deferrals are set up for Intune with -DeferRunInterval, is the subject of module PS-M10 (Intune integration) of the advanced course.
  • Configuration Manager. Interactive deployments are possible and common, for example an available deployment in Software Center with a welcome dialog. Since PSADT 4.1.0, the option Allow users to view and interact with the program installation is no longer required for the dialogs, according to the release notes. As lesson 2 showed, -DeployMode Interactive fails with 1602 in 4.1.8 when nobody is signed in, so it does not suit a required deployment that also runs at night.

User-facing deployments with dialogs, deferrals and restart prompts are covered in depth in the advanced course.

Detection

A detection rule tells the deployment tool, on each device, whether the application is installed. The tool checks it before the installation, to skip devices that already have the application, and after the installation, to confirm the result. A package that returns 0 but whose detection rule then finds nothing is not reported as installed; for a required app, Intune offers the app again within about 24 hours, according to the Win32 app documentation.

For an MSI package, the MSI product code is the simplest rule and the one this course uses. Both tools offer it as a rule type:

ToolWhereValue
Configuration ManagerDetection Method, Add Clause, Setting Type Windows InstallerThe product code from lesson 4, step 3; Browse can read it from the MSI in Files\
IntuneDetection rules, Manually configure detection rules, Rule type MSIThe same product code, typed in; MSI product version check optional

For Intune, the product code is typed in. Microsoft documents that the Content Prep Tool retrieves the MSI information Intune needs when the setup file is an MSI; for a PSADT package the setup file is the launcher, so Notes.md is the source.

Registry and file rules are the usual alternatives for EXE installers. Script rules are the most flexible and have a precise contract, documented on Microsoft Learn for both tools:

Script outcomeConfiguration ManagerIntune
Exit code 0, output on STDOUT, STDERR emptyInstalledInstalled
Exit code 0, STDOUT emptyNot installed (STDERR empty) or unknown (STDERR not empty)Not installed
Exit code 0, output on STDOUT and on STDERRInstalledNot installed
Exit code not 0UnknownNot installed

The sources are the detection sections of Create applications for Configuration Manager and of Add and assign Win32 apps for Intune. A script rule must therefore write something to STDOUT when the application is found and must not write to STDERR. Detection strategies beyond the product code are part of the advanced course.

Configuration Manager

The ConfigMgr deployment article on the blog covers each tab in detail. For a first package, these settings are the ones to check:

SettingValue for this package
ApplicationManually specify the application information; name, publisher and version from the notes
Deployment typeScript Installer
Content locationUNC path of the Package folder; the site server's computer account needs read access
Installation programInvoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent
Uninstall programInvoke-AppDeployToolkit.exe -DeploymentType Uninstall -DeployMode Silent
Repair programInvoke-AppDeployToolkit.exe -DeploymentType Repair -DeployMode Silent; in the lab run with version 2603, the create wizard showed no repair field, and the value was set afterwards in the deployment type properties, Programs tab
Run installation and uninstall program as 32-bit process on 64-bit clientsOff
Detection methodWindows Installer, product code
Installation behaviorInstall for system (in the lab run with version 2603, a new Script Installer deployment type started with Install for user)
Logon requirementWhether or not a user is logged on (the default is Only when a user is logged on)
Allow users to view and interact with the program installationOff; not needed for PSADT dialogs since 4.1.0
Maximum allowed run timeDefault 120 minutes is sufficient
Post-installation behaviorDetermine behavior based on return codes

Create applications on Microsoft Learn lists the default return codes of a Script Installer deployment type as 0 (Success (no reboot)), 1641 (Hard Reboot), 3010 (Soft Reboot) and 1618 (Fast Retry). In the lab run with version 2603, the console also added 1707 (Success (no reboot)), which Learn lists only for Windows Installer deployment types. These cover the success and reboot codes of this package. Because the command lines leave out -SuppressRebootPassThru (lesson 2), a 3010 from the MSI reaches Configuration Manager as Soft Reboot instead of being turned into 0. For Fast Retry, the client retries every two hours, up to 10 times; PSADT itself returns 1618 when a dialog times out (lesson 5). Any other non-zero code, such as 1603 or 60001, counts as a failure unless it is added on the Return Codes tab. The content is then distributed to a distribution point and the application deployed to a small test collection.

A deferral is not part of this package, because it runs with -DeployMode Silent. A package that offers Defer ends with 1602 (lesson 5), which is not in the default list. The PSADT FAQ suggests setting DeferExitCode in config.psd1 to 1618 for Configuration Manager, so that a deferral triggers Fast Retry. Deferrals, countdowns and the matching exit codes are covered in module PS-M04 (User experience) of the advanced course.

Intune

The Intune route adds one preparation step. The Microsoft Win32 Content Prep Tool packs the package folder into an .intunewin file:

bat
REM Convert the PSADT package folder into an .intunewin file
IntuneWinAppUtil.exe -c "C:\Lab\Packages\7-Zip\26.06\Package" -s "C:\Lab\Packages\7-Zip\26.06\Package\Invoke-AppDeployToolkit.exe" -o "C:\Lab\Intune\7-Zip\26.06" -q

-c is the folder whose complete content is packed, -s the setup file inside it, given as a full path as in the Microsoft example, -o the output folder, and -q quiet mode. In quiet mode there are no prompts, an existing output file is overwritten, and a missing output folder is created. The tool itself must not be inside the -c folder, because everything in that folder ends up in the file. The tool is a download from the Microsoft-Win32-Content-Prep-Tool repository on GitHub (version 1.8.7 on 2026-11-30); IntuneWinAppUtil.exe -v shows the version.

Check: the output folder contains one .intunewin file with a current time stamp. This file is uploaded on the App package file page of the Win32 app.

SettingValue for this package
App typeWindows app (Win32)
Installer typeCommand line
Install commandInvoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent
Uninstall commandInvoke-AppDeployToolkit.exe -DeploymentType Uninstall -DeployMode Silent
Install behaviorSystem
Installation time requiredDefault 60 minutes is sufficient
Device restart behaviorDetermine behavior based on return codes
Return codesIntune adds a list by default; confirm 0 Success, 3010 Soft reboot, 1641 Hard reboot and 1618 Retry, and add any that are missing
Detection ruleMSI, product code
AssignmentRequired or Available for enrolled devices to a small test group

Intune has no logon requirement setting; the Win32 app documentation states that users do not need to be signed in for a Win32 app to install. It also describes the restart options: with Determine behavior based on return codes, a Hard reboot code restarts the device immediately and a Soft reboot code only notifies the user. A Retry code makes the agent try three times, five minutes apart. The documentation does not list the values of the default return codes, so the check above is worth the minute it takes.

Intune also offers a PowerShell script installer type for Win32 apps. How it relates to PSADT packages is described in PowerShell Script Installers for Intune Win32 Apps. For a first package, the command line installer type is sufficient.

What to verify after the first deployment

The first deployment to a test device or test group closes the loop. Three places show the result.

WhereConfiguration ManagerIntune
Client logs of the toolC:\Windows\CCM\Logs\AppEnforce.log (install and uninstall: command line, exit code), AppDiscovery.log (detection)C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AppWorkload.log (Win32 app check-in, install, detection); IntuneManagementExtension.log (agent check-in and policy)
PSADT logC:\Windows\Logs\Software\IgorPavlov_7-Zip_26.06_x64_EN_01_PSAppDeployToolkit_Install.logSame path and name
ConsoleMonitoring > Deployments; Software Center on the clientApps > All apps, the app, Monitor > Device install status

The log descriptions follow the ConfigMgr log files reference and the Intune management extension page. CMTrace from lesson 3 reads both.

A useful order: the tool's log first, to see the command line it ran and the exit code it received; then the PSADT log, to see what happened inside the package. If the exit code is 0 but the tool reports a failure, the detection rule is the first suspect. The PSADT log also shows the deploy mode the session chose, in Installation is running in [Silent] mode., and the account it ran under, in Current User is [NT AUTHORITY\SYSTEM]. A line starting with Session 0 detected shows that the toolkit runs under a system or service account.

Common mistakes

SymptomCauseFix
The tool reports a failure, but the PSADT log ends with exit code 0The detection rule does not find the application after the installation; Intune reports "Application installation succeeded but application is not detected". A likely cause is a product code from a different buildTake the product code from the MSI in Files\ (Notes.md) and correct the rule
A ConfigMgr script detection rule returns UnknownThe script exits with a non-zero value; ConfigMgr then reports the detection status as UnknownEnd the script with exit code 0 and write to STDOUT only when the application is found
An Intune detection script writes to STDOUT and exits with 0, but the app counts as not installedAny data on STDERR makes Intune evaluate the result as not installedRemove output to STDERR, including warnings and errors from commands in the script
An Intune command line that calls powershell.exe runs in 32-bit PowerShellIntune launches a 32-bit PowerShell for powershell.exe in the install and uninstall commandCall Invoke-AppDeployToolkit.exe, or use %SystemRoot%\Sysnative\WindowsPowerShell\v1.0\powershell.exe
A ConfigMgr deployment reports a failure with 1602 after a user deferred1602 is not in the default return codes of a Script Installer deployment typeSet DeferExitCode to 1618 for ConfigMgr; details in module PS-M04 of the advanced course

Try it

The exercise produces a handover sheet. With a lab, it continues to a real test deployment.

  1. On the Hyper-V host, apply the checkpoint psadt-L6-start of CL01 and start the VM if it is off. If the checkpoint does not exist yet, apply psadt-L5-end and take it: Checkpoint-VM -Name CL01 -SnapshotName psadt-L6-start. Other hypervisors: the equivalent snapshot. CL01 serves as the test device in steps 3 to 6 if it is a Configuration Manager client or enrolled in the Intune test tenant. Expected: CL01 is clean. Check: Get-VMCheckpoint -VMName CL01 lists psadt-L6-start.

  2. On PKG01, create C:\Lab\Packages\7-Zip\26.06\Handover.md with the following content, and fill in the product code from Notes.md:

    text
    Application:        7-Zip 26.06 x64
    Publisher:          Igor Pavlov
    Version:            26.06
    PSADT version:      4.1.8
    Package revision:   01
    Content:            \\<server>\<share>\7-Zip\26.06\Package
    Install command:    Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode Silent
    Uninstall command:  Invoke-AppDeployToolkit.exe -DeploymentType Uninstall -DeployMode Silent
    Repair command:     Invoke-AppDeployToolkit.exe -DeploymentType Repair -DeployMode Silent
    Install context:    System, whether or not a user is logged on
    Detection:          MSI product code {........-....-....-....-............}
    Return codes:       0 success, 3010 soft reboot, 1641 hard reboot, 1618 retry
    PSADT log:          C:\Windows\Logs\Software\IgorPavlov_7-Zip_26.06_x64_EN_01_PSAppDeployToolkit_<Type>.log
    Tested on:          <OS version>, <date>, test cycle from lesson 5 passed

    Then close the open line of the pre-handover checklist in Notes.md: the command lines are now written down. Expected: the sheet holds every value the deployment tool asks for, with no value that has to be looked up again. Check: the product code in Handover.md equals the one in Notes.md: Select-String -Path 'C:\Lab\Packages\7-Zip\26.06\Handover.md', 'C:\Lab\Packages\7-Zip\26.06\Notes.md' -Pattern '\{[0-9A-F-]{36}\}' shows the same product code in both files; Notes.md also lists the upgrade code, which the pattern matches as well.

  3. With a Configuration Manager lab (optional): copy the Package folder to the content share, create the application and deployment type with the values from the sheet, distribute the content, and deploy it as Required to a collection with one test device. Expected: the console reports the application as installed on the test device.

  4. With an Intune test tenant (optional): create the .intunewin file, add a Win32 app with the values from the sheet, and assign it as Required to a group with one test device. Expected: the output folder holds one .intunewin file, and Device install status reports the app as installed on the test device.

  5. With a lab (optional): on the test device, after the installation, open the tool's client log and the PSADT log. Expected: AppEnforce.log or AppWorkload.log shows the install command line and exit code 0; the PSADT log ends with install completed in [...] seconds with exit code [0] and shows Installation is running in [Silent] mode.

  6. With a lab (optional): change the assignment or deployment to uninstall, and confirm the removal in the same logs. Expected: the uninstall leaves no 7-Zip entry in the uninstall registry. Check: the registry query from lesson 1, step 6, returns nothing.

  7. On the host, revert CL01 to psadt-L6-start, then take the checkpoint psadt-L6-end. Expected: CL01 is clean; the package, Notes.md and Handover.md are on PKG01. Check: Get-VMCheckpoint -VMName CL01 lists psadt-L6-end.

Check your understanding

  1. Why do the command lines call Invoke-AppDeployToolkit.exe rather than powershell.exe with the wrapper script?
Answer

The launcher starts Windows PowerShell with the right parameters, runs the wrapper from the package folder and passes the exit code back. In Intune, a direct powershell.exe call in the command line starts 32-bit PowerShell, which the launcher avoids.

  1. Which deploy mode suits a required Intune deployment, and why?
Answer

Silent. Microsoft documents that Intune does not support interactive application installations, and a silent package does not depend on a signed-in user.

  1. A detection script writes Installed to STDOUT, also writes a warning to STDERR, and exits with 0. How do ConfigMgr and Intune evaluate it?
Answer

Configuration Manager reports the application as installed. Intune evaluates the result as not installed, because any data on STDERR makes the detection fail there.

  1. The tool reports a failure, but the PSADT log ends with exit code 0. What is checked first?
Answer

The detection rule. The package succeeded, but the rule did not find the application afterwards, for example because of a wrong product code or a rule for a different build.

  1. A required ConfigMgr deployment returns 1618. What does the client do, and what happens in Intune when 1618 is listed as a Retry code?
Answer

1618 is a Fast Retry code in the Script Installer defaults: the ConfigMgr client retries every two hours, up to 10 times. In Intune, a Retry code makes the agent try three times, five minutes apart. In both tools it means that another installation was running, or, from PSADT, that a dialog timed out.

  1. For the ConfigMgr deployment type of this package, which installation behavior and logon requirement are set, how does the logon requirement differ from the default, and which client log shows the command line and exit code of the first installation? Which log has this role for Intune?
Answer

Install for system and Whether or not a user is logged on; the default logon requirement is Only when a user is logged on, which would hold back a required deployment on a device without a signed-in user. AppEnforce.log records the enforcement actions, install and uninstall, of applications on the client. For Intune, AppWorkload.log in C:\ProgramData\Microsoft\IntuneManagementExtension\Logs covers Win32 app deployment activities.

Summary

  • The tested package folder and a handover sheet are what the deployment tool receives; the package is not edited after testing.
  • Both tools call Invoke-AppDeployToolkit.exe with -DeploymentType and, for a first package, -DeployMode Silent.
  • The MSI product code is the detection rule for this package; script rules need STDOUT output, exit code 0, and in Intune an empty STDERR.
  • ConfigMgr needs a Script Installer deployment type running as system, whether or not a user is logged on; Intune needs an .intunewin file and a Win32 app with System install behavior.
  • Return codes decide how each tool reacts: success, soft or hard reboot, retry, or failure; the default lists are checked, not assumed.
  • After the first deployment, the tool's client log and the PSADT log together explain the result.

Sources

Where to go next

This is where the free course ends. The package built here installs, uninstalls and repairs one MSI, is tested on a clean VM, and is ready for a deployment tool. The following articles go further on the topics touched in the course:

A deeper course for supporters, covering EXE installers, user context, user interaction, upgrades, detection strategies and troubleshooting, is in preparation.

Download the one-pager for this lesson (PDF, 126 KB) ↓