Set a Microsoft Intune application requirement PowerShell script

0
Designer

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.

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

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

On the following page go to Windows.

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

Select Properties followed by Edit.

In the Edit application section, choose + Add.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *