Using the New-IntuneWin32AppIcon function, the image-file can be Base64 encoded easily which is required for the Add-IntuneWin32App function. It seems the exit code is also zero but the application is not detected. to add as a requirement, but I don't know which output or which data type it generates. The name of the key will be the PrinterName we specify when we install the printer. so I went back to a ps1 file. When the script exits with the value of 0, the script execution was success. Next from the Intune portal > Client Apps select Add App App Type: Windows app (Win32) App Package File: Choose your SmartCard.intunewin file App Information: Fill as you like Program: a. Below is a step by step showing how an Intune Script can be created using the script attached here. Step 2 - Create the deployment type. Save the script and package it into an .intunewin file using the Microsoft Win32 Content Prep Tool.. In the Requirement type field, choose Script. Sign in to vote. In your Intune portal, navigate to Apps, then All Apps, click the Add button, change the App type to Windows app (Win32) and click Select. A Win32 App can have multiple detection rules and all detection rule must be met to detect the application. Second output channel indicates app was detected - STDOUT data indicates that the app was found on the client. Click Select app package file, Click the Blue Folder icon to open the browse windows. This is where the win32 app comes into play in Intune (Microsoft Endpoint Manager). The extension that facilitates the execution of PowerShell scripts on workstations from Intune AND also processes Win32 app installation and detection, is a 32-bit application. Intune will install the Intune Management extension on the device if a PowerShell script or a Win32 app is targeted to the user or device. as for the hiding the program window, create the app to run for user but deploy it to computes. As a detection rule use something to identify if it is installed like .exe file in the Program path, then target with assignment "uninstall" to you devices where it is actually installed and this should trigger the . Please see the following screenshot for reference. Step 1 - Create the application. To add or upload .intunewin file to Intune, follow the below steps. Generating a detection.xml file in a sub folder 'Metadata'. Windows application size is capped at 8 GB per app. This is a script that can be used with MS Intune as a custom detection rule to detect if Adobe Reader is installed on a computer. Manually Configure detection rules; Path: C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader; File or folder: AcroRd32.exe; Detection method: File or folder exists It executes in the 32-bit context and therefore when you call your PowerShell script it executes the 32-bit version of PowerShell. If you decide to go via script, until you're already done here. Intune Win32 App Deployment With this PowerShell script, we will now generate win32app in intune and assign it to the device group. In the Add App dialog, click Select app package file, then click the blue folder icon, navigate to your previously created HuntressInstaller.intunewin package and click OK. Select All Apps, Click Add. The detection rules ensure that app installation only start if it's not installed yet. Gathering Info; Step 1: Create a New Script; Step 2: Assign the Script Step 5 - Distribute and deploy the application. Click + Add and in the next step we will add Win32 app. The Printer has a registry key that can be used for detection. Computing a SHA265 hash. 5 . Sign in to the Microsoft Endpoint Manager admin center https://endpoint.microsoft.com Select Apps > Windows > Windows apps. 1 Instead of using PowerShell script, you can just use the install and uninstall commands directly in the App configuration settings. Those detection rule formats are categorized as mentioned below. . In Microsoft Intune, Detection Rules are used to determine the presense of a Win32 App. .PARAMETER DisplayName Specify the display name for a Win32 application. Select the existing Win32 application from the list. Browse to and select the app requirement script. 3 1 # Convert image file to icon 2 $ImageFile = "C:\IntuneWinAppUtil\Icons\AdobeReader.png" 3 $Icon = New-IntuneWin32AppIcon -FilePath $ImageFile Create Adobe Reader DC Win32 app This script detects multiple versions of Adobe Reader and can be easily modified to detect more versions if needed. Powershell detection method example. Scroll down and click on Edit in the Detection rules. Deploy the win32 application with Intune - Part 4 Detection rules Intune. Each dependency will adhere to Intune Win32 app retry logic (try to install 3 times after waiting for 5 minutes) and the global re . Much like a standard line-of-business (LOB) app, you can add a Win32 app to Microsoft Intune. Prepare for upload. Click the folder icon next to the Script file field. In the Win32 app wizard, select the requirements tab and click +Add. as for the hiding the program window, create the app to run for user but deploy it to computes. Intune runs the the Configure.ps1 PowerShell Script (shown below) PowerShell uses WMI to check to see if any users are running the . Boolean wont work, it needs to be something or empty. Barenstark314 Additional comment actions This is the ultimate answer. Is there a better solution for detection rules which are mandatory or a simple create folder/file/registry entry at the end of the script and assign detection rule to look for that? And, with vbscript, the script doesn't run because my detection rule isn't finding things to detect a successful deployment. Adding the script as a requirement rule - Using the Script in an Intune Win32 Application - Targeting based on the Enrollment Date Once the app is assigned as required, you should see that any existing devices in the scope of the assignment and enrolled prior to the date you have configured report back with the status "not applicable." 4 . Select Devices and then select Windows devices. Because you have already prepared this in the point above by . 3 . Enter the relevant information on the App Information page, then select Next. For options 2, using a PowerShell script deployed in Intune, contiune reading. Note that this will populate the Script name field with the script name. I have described how to do this here: Create Win32 App / .intunewin. Configure app specific rules used to detect the presence of the app. The Win32 app also requires a detection method. 2 . Specify the name of the PowerShell script and you may add a description as well. Select App type Other>Windows app (Win32), Click Select. Using it is child's play: Prepared package upload to app profile Installation command and return codes Going further, you will need to specify command for installing your package. No .BAT file needed. Click Next. 2 Based on the error code, typically occurs when a user uninstalls an app manually after Intune successfully installed the app. Additionally, there are steps to help gather the required information. Modify the Powershell script. Deploy PowerShell Script using Intune. When the script exit code is 0, Intune will detect the STDOUT in more detail. Step 3 - Create the Powershell detection method. Install Command: install.cmd b. Uninstall Command: uninstall.cmd c. Install Behaviour: choose system or user Requirements: Choose OS and architecture A win32 app requires an executable to run even when running a script like batch file or CMD extension file. .PARAMETER ID Specify the ID for a Win32 application. On the Windows - Windows apps blade, select a Win32 app (or create a new one) and click Properties > Detection rules to open the Detection rules blade On the Detection rules blade, the different detection rule formats of Win32 apps are shown. The content prep tool allows Intune Administrators to wrap install files for Win32 Applications, and use silent install switches or custom install scripts to install the wrapped application. Also, my detection rule was wrong here is my new detection rule: Select a PowerShell script that will detect the presence of the app on the client. powershell -Ex Bypass -windowstyle Hidden -file WhateverScript.ps1. Compressing complete working folder and create again an .intunewin file. Detection rule. Click the Select output data type drop down. so I went back to a ps1 file. Result is: the powershell script gets executed, but the win32 app doesn . Create a folder called ConfigMgrclient ( C:\ConfigMgrclient) 2.Copy the client files into ConfigMgrclient ( C:\ConfigMgrclient\Client) 3. In this step we will add the .intunewin file and begin Intune Win32 app deployment. Click Apps and select All Apps. The app will be detected when the script both returns a 0 value exit code and writes a string value to STDOUT. MS Intune's build in detection rules are to limited to detect multiple versions of a piece of . Then in the win32 app "install command" line in intune, i use this as mine. I have the script below to detect if the config.xml file is deployed. so you would change the else to {} It executes silently and i've had zero issues with it. First, as the app simply runs a PowerShell script that sets the registry key, the install command I was using created the key in the WOW6432node because the IME runs as a 32-bit app. So I had to change the command to use SysNative: %windir%\SysNative\WindowsPowershell\v1.0\PowerShell.exe -ExecutionPolicy Bypass -File MyInstallScript.ps1 Compressing the source folder of the Win32 apps and its files to a sub folder 'Contents' with the new extension .intunewin. Locate your PowerShell script and click Open. You have two options for the detection rule, either you use a script (more flexible) or a static detection rule based on a folder. Login to the Microsoft Endpoint Manager admin center. They key is located at:- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers Printer Detection Method Intune App package settings: Install command: powershell.exe -executionpolicy bypass -file PrinterDrivers.ps1 Get all or a specific Win32 app by either DisplayName or ID. Go hereto get wrapping tool . Enter a name in the Script name field. We do not look for a particular string from STDOUT. So here we go, another small script to get back all the Win32 I've used this to run win32 apps that call on powershell scripts that map drives, install printers, or install applications, etc. Select App - Intune Win32 App Deployment Detection Methods Select the application and select Properties. To add a new PowerShell script, click Add button and deploy it to Windows 10 devices. Script file - Select a PowerShell script that will detect the presence of the app on the client. Set another settings as required. 6 . domain.onmicrosoft.com. I tried with the switches and with a vb script that runs the powershell and it doesn't work. From the Select output data type drop down box, select String. 1. Save the above PowerShell script as install.ps1 into (C:\ConfigMgrclient). In Intune, this allows us to deal with routines and processes in a script and then check the installation with another script (custom detection script) or predefined detection rules (MSI, EXE, file or registry key). This will be used to define what the requirement will capture from the PowerShell script. It may be possible if it is a Intune Win32 support (.intunewin) and specify the uninstall command line correctly. Select the .intunewin file you have created, Click Open and then click OK.