All guides

Set a Microsoft Intune application requirement PowerShell script

Stop an Intune app from installing on the wrong devices by using a PowerShell requirement script, for example to target only HP hardware.

Did you ever faced the fact that an Intune application is being installed on devices that you rather not want to have that certain application? For example, an application that is needed for a specific vendor e.g. all HP devices and not have to be installed on device from other vendors or virtual machines.

Consider the following:

  • Application is assigned required.

  • New Autopilot enrollment (so there is no hardware inventory).

  • Device has been wiped (hardware inventory is being deleted).

When targeting an application with a required assignment to devices and in the Enrollment Status Page the following settings are enabled the Autopilot enrollment will fail with the 0x81036502 error.

  • Block device use until all apps and profiles are installed.

  • Block device use until required apps are installed if they are assigned to the user/device.

Screenshot: Block device use until required apps are installed if they are assigned to the user/device

Well, let’s create an application PowerShell script requirement for this!

In your browser go to https://intune.microsoft.com and select Apps.

Screenshot: In your browser go to https://intune.microsoft.com and select Apps

On the following page go to Windows.

Screenshot: On the following page go to Windows

Choose the application where you want to set a requirement script on.

Screenshot: Choose the application where you want to set a requirement script on

Select Properties followed by Edit.

Screenshot: Select Properties followed by Edit

In the Edit application section, choose + Add.

Screenshot: In the Edit application section, choose + Add

In the Requirement type, choose Script.

Screenshot: In the Requirement type, choose Script

Fill in the required fields like:

  • Requirement type:

  • Script name:

  • Output data type:

  • Operator

  • Value

Upload the script that can be found on my GitHub and choose OK.

Screenshot: Upload the script that can be found on my GitHub and choose OK

The application will no longer be installed on other devices that in this case HP devices. E.g. on devices from other brands or virtual machines.

Portrait of Jeroen Ebus

Jeroen Ebus

Modern workspace & cloud consultant

Modern workspace and cloud consultant at PeopleRock . Working in IT since 2007, with a focus on end user computing: Microsoft Intune, Windows, Azure and security.

Comments

Comments are powered by GitHub Discussions (Giscus). Nothing is loaded from GitHub until you click the button.