Excellent question. This is a very common scenario. Since the file is already on the laptop, you don't need Intune to deliver the file, just to execute the installation command.
The best and most modern method to do this in Intune is to package the installer as a Win32 App. This gives you superior reporting, dependency handling, and detection logic compared to a simple script.
Here’s a step-by-step guide for both the recommended method and a fallback script method.
This method treats your installer like a formal application, which is Intune's preferred approach.
Even though the file is on the end-user's laptop, Intune needs a "source" for the app. You'll create a simple package.
- Create a new folder on your computer (e.g.,
Action1_Package). - Inside this folder, create a simple PowerShell script or a batch file that will run the installer. Let's use a batch file for simplicity.
- Create a new text file and name it
Install_Action1.cmd.
- Create a new text file and name it
- Edit this
.cmdfile and put the following command in it:start /wait %~dp0action1.exe /S
%~dp0means "the drive and path of this batch file". This tells the command to look foraction1.exein the same directory as the script./Sis a common silent install switch. You must find the correct silent install command-line parameter for Action1. It might be/quiet,-silent, etc. Check Action1's documentation. The/Sis just a common example.
This tool packages your folder into the .intunewin format Intune requires.
- Download the Microsoft Win32 Content Prep Tool from GitHub.
- Run the tool (
IntuneWinAppUtil.exe). - When prompted:
- Source folder: Enter the path to your
Action1_Packagefolder. - Setup file: Enter the name of your installer script:
Install_Action1.cmd. - Output folder: Choose a destination for the
.intunewinfile.
- Source folder: Enter the path to your
- The tool will create a single
.intunewinfile (e.g.,Action1_Package.intunewin).
- Go to the Microsoft Intune admin center.
- Navigate to Apps > All apps > Add.
- Under App type, select Windows app (Win32).
- Click Select.
- App information: Upload the
.intunewinfile and enter details like Name, Description, and Publisher (e.g., "Action1"). - Program: This is the core configuration.
- Install command:
Install_Action1.cmd - Uninstall command: (Provide one if available, e.g.,
"%ProgramFiles%\Action1\uninstall.exe" /Sor leave blank). - Install behavior: System
- Install command:
- Requirements: Select the appropriate OS architecture (e.g., 64-bit) and minimum OS version.
- Detection rules: This is critical. You need a rule so Intune knows if the app is already installed.
- Rules format: Manually configure format
- Rule type: Choose the best method:
- File: Check if
C:\Program Files\Action1\action1.exeexists. - Registry: Check for a specific key, e.g.,
HKEY_LOCAL_MACHINE\SOFTWARE\Action1with a specific version. - MSI: If Action1 uses an MSI, you can use the product code.
- File: Check if
- Assignments: Assign the app to the required device group containing your laptops. Set the assignment to Required.
- Complete the wizard.
The laptops will check in with Intune, see the "Required" assignment, and execute the installation command from the local file.
If packaging as a Win32 app seems too complex for a one-off task, a simple PowerShell script will work.
-
Create a new file named
Install-Action1.ps1. -
Put the following code inside it. You will need to adjust the path to
action1.exeand the silent install switch.# Define the path to the local Action1 installer $InstallerPath = "C:\Path\To\The\Downloaded\action1.exe" # Check if the installer file exists if (Test-Path $InstallerPath) { Write-Output "Installer found at $InstallerPath. Beginning installation..." # Run the installer silently. CHANGE /S TO THE CORRECT SWITCH! $InstallProcess = Start-Process -FilePath $InstallerPath -ArgumentList "/S" -Wait -PassThru # Check the exit code if ($InstallProcess.ExitCode -eq 0) { Write-Output "Action1 installed successfully." exit 0 # Exit code 0 tells Intune the script was successful } else { Write-Output "Installation failed with exit code: $($InstallProcess.ExitCode)" exit 1 # Exit code 1 tells Intune the script failed } } else { Write-Output "ERROR: Installer not found at $InstallerPath." exit 1 }
- Go to the Microsoft Intune admin center.
- Navigate to Devices > Scripts > Add > Windows 10 and later.
- Basics: Give it a name, e.g., "Install Local Action1".
- Settings: Upload your
Install-Action1.ps1file.- Run this script using the logged on credentials: No
- Enforce script signature check: No
- Run script in 64 bit PowerShell Host: Yes
- Assignments: Assign the script to the device group containing your laptops.
- Review and add.
| Factor | Win32 App (Method 1) | PowerShell Script (Method 2) |
|---|---|---|
| Reporting | Excellent. Clear "Installed/Failed" status. | Basic. Shows "Succeeded" if script runs, even if install fails. |
| Reliability | High. Has built-in detection logic to prevent re-installs. | Lower. Will run the script every time, which could re-run the installer. |
| Retry Logic | Yes. Intune will retry failed installations. | Limited. |
| Complexity | More steps to set up initially. | Quicker to set up for a simple task. |
| Best For | Production environments, reliable reporting. | Quick one-off tasks, testing. |
Recommendation: Use Method 1 (Win32 App). It is the more robust, manageable, and "correct" way to handle software installation in a modern management system like Intune. The initial setup is worth it for the superior control and reporting you get.