Understanding Win32 App Requirements Rule in Microsoft Intune

In Microsoft Intune , Win32 Apps Requirements are rules which must met for the application to get installed. You can specify the requirements when creating Win32 app. The application will install only if requirements are met. For example, you want to install an application only if hard disk have at least 5 GB free space.

Let’s explore the Requirements rule available in Microsoft Intune Win32 app.

Note: Follow this blog post if you are looking for the steps to create Win32 application in Microsoft Intune.

Table of contents

Win32 App – Mandatory Requirement:

These are mandatory requirement which you must configure when creating a win32 app.

Operating system architecture: Choose the architectures needed to install the app.

Options: 32 bit / 64 bit

Minimum operating system: Select the minimum operating system needed to install the app.

Options: Windows 10 1607 and above

Intune | Wind32 App Requirements

Win32 App – Optional Requirement:

These are optional requirement which you can configure as per your need.

Disk space required (MB): Add the free disk space needed on the system drive to install the app.

Example: 1000

Physical memory required (MB): Add the physical memory (RAM) required to install the app.

Example: 4096

Minimum number of logical processors required: Add the minimum number of logical processors required to install the app.

Minimum CPU speed required (MHz): Add the minimum CPU speed required to install the app.

Win32 App – Additional Requirement Rules

Additional Requirement rules provide extended options to configure win32 app requirements. The following Requirement Types are currently available.

File : This Requirement rule verify requirements rules based on file or folder existence, date, version, or size.

To add a File based requirements rule, you need to click on +Add at bottom of Requirements page and select File from Requirement type.

Intune - File Based Requirements Rule

You have to provide following details when using this Requirement Rule.

  • Path: Enter the full path of the folder that contains the file or folder to detect.
  • File or folder: Enter the file or folder to detect.
  • Property: Select the type of rule used to validate the presence of the app.
  • File or folder exists
  • Date modified
  • Date created
  • String (version)
  • Size in MB

Registry : This Requirement rule allow you to validate the requirements based on registry settings such as key existence, string comparison or version.

To add a Registry based requirements rule, you need to click on +Add at bottom of Requirements page and select Registry from Requirement type.

Intune - Registry based Requirements Rule

You have to provide following details when using this detection rule.

  • Key path: The full path of the registry key that contains the value to detect.
  • Value name: The name of the registry value to detect. If this value is empty, the detection will happen on the key. The (default) value of a key will be used as detection value if the detection method is other than file or folder existence.
  • Registry key requirement: Select the type of registry key comparison that’s used to validate the presence of the app. The following comparison type are available.
  • Key exists
  • Key does not exist
  • String comparison
  • Version comparison
  • Integer comparison

Script : This Requirements rule provide further options to assess requirements which cannot be covered using file or registry methods. here we can use a Powershell script to determine application requirements.

To add a Script based requirements rule, you need to click on +Add at bottom of Requirements page and select Script from Requirement type.

Intune - Script Based Requirements Rule

We have to provide following mandatory details when using this detection rule.

  • Script Name: Enter the name of Script. For example Check Disk Space
  • Script File: Click on Browse button and select the script file.
  • Select Output Data Type: Select the output data type. The following output data types are currently available.
  • String
  • Date and Time
  • Integer
  • Floating Point
  • Version
  • Boolean

Monitor Requirements Rule Behavior

Now we will understand how requirements rules are evaluated at client end. As you know, every details related with Win32 app deployment are logged in IntuneManagementExtension.log file. Hence, we will analyze the logs to decode the steps. Usually you don’t have to look into logs for the deployment however these information will help you in troubleshooting the issue when you have to deal with deployment failures.

Mandatory / Optional Requirements

We have configured both mandatory and one optional requirements here.

Operating System architecture : 64-bit

Minimum operating system : Windows 10 1607

Disk space required : 5000 MB

Intune Win32 App Requirement Rules - File

Once we started the application installation through company portal, the Requirements were quickly visible in Intune Management Extension log under Check applicability section.

[Win32App] applicationRequirementMetadata RequiredOSArchitecture: 2, client Is64BitOperatingSystem: True, nativeMachine IsArm64: False, applicability: Applicable.

[Win32App] applicationRequirementMetadata expected version: 10.0.14393, client version: 10.0.19042, applicability: Applicable.

[Win32App] applicationRequirementMetadata RequiredFreespace: 5,000.00, availableFreeSpaceInMB: 156,379.00 on Drive C:\, applicability: Applicable.

Below are complete excerpts from IntuneManagementExtension.log for Check Applicability section.

<![LOG[[Win32App] ===Step=== Check applicability]LOG]!><time="22:23:01.9740518" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="16" file="">
<![LOG[[Win32App] applicationRequirementMetadata RequiredOSArchitecture: 2, client Is64BitOperatingSystem: True, nativeMachine IsArm64: False, applicability: Applicable.]LOG]!><time="22:23:01.9825346" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="16" file="">
<![LOG[[Win32App] applicationRequirementMetadata expected version: 10.0.14393, client version: 10.0.19042, applicability: Applicable.]LOG]!><time="22:23:02.0233144" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="16" file="">
<![LOG[[Win32App] applicationRequirementMetadata RequiredFreespace: 5,000.00, availableFreeSpaceInMB: 156,379.00 on Drive C:\, applicability: Applicable.]LOG]!><time="22:23:02.0869701" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="16" file="">
<![LOG[[Win32App] applicationRequirementMetadata.RequiredMemory is , skip check.]LOG]!><time="22:23:02.0879780" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="16" file="">
<![LOG[[Win32App] applicationRequirementMetadata.RequiredCPUSpeed is , skip check.]LOG]!><time="22:23:02.0879780" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="16" file="">
<![LOG[[Win32App] applicationRequirementMetadata.MinimumNumberOfProcessors is , skip check.]LOG]!><time="22:23:02.0889723" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="16" file="">

File:

We have configured below requirement rule. The application will installed only if D:\Program File folder exists.

The IntuneManagementExtension.log shows that requirement rule was evaluated and folder was exists. Hence the requirement was met for application installation.

[Win32App] Checked under Path: D:\, filePath:D:\Program Files, agent was checking under expanded: D:\Program Files, applicationDetected: True

Below are complete excerpts from IntuneManagementExtension.log for Check Extended requirement.

<![LOG[[Win32App] ===Step=== Check Extended requirement rules]LOG]!><time="23:35:17.6812330" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] ProcessRequirementRules starts]LOG]!><time="23:35:17.6821853" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] ProcessRequirementRules Parsing InstallEx...]LOG]!><time="23:35:17.6821853" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] RequirementType 2]LOG]!><time="23:35:18.1737361" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] Start requirementManager SideCarFileRequirementManager]LOG]!><time="23:35:18.1747403" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] Disable Wow64FsRedirection]LOG]!><time="23:35:18.5346625" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] Checked under Path: D:\, filePath:D:\Program Files, agent was checking under expanded: D:\Program Files, applicationDetected: True]LOG]!><time="23:35:18.5359328" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] Revert Wow64FsRedirection]LOG]!><time="23:35:18.5369375" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] requirementManager SideCarFileRequirementManager got applicationDetectedByCurrentRule: True as system]LOG]!><time="23:35:18.5379325" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] Completed detectionManager SideCarFileRequirementManager, applicationDetectedByCurrentRule: True]LOG]!><time="23:35:18.5379325" date="4-16-2022" component="IntuneManagementExtension" context="" type="1" thread="8" file="">
<![LOG[[Win32App] Extended requirement rules processing complete. isApplicationApplicable: Applicable]LOG]!

Registry

The behavior for registry based requirement rules are almost similar to file / folder.

Script

We considered following requirements here for the deployment.

The application will installed on D: drive. The requirement rule to be configured to confirm that D: drive is not a CD/DVD or removable storage device.

Intune Win32 App - Requirement rule - Script

Here is a Powershell script which we used to validate custom Intune win32 app requirements. The script will simply check whether D: drive is a local disk or not. The script will write the output to STDOUT. The requirements configured above will check if returned value is “LocalDisk”.

foreach ($drive in $ldisk)
{
    if ($drive.DeviceID -eq "D:") {
        if ($drive.DriveType -eq 3)
            {Write-Host "LocalDisk"
            Exit} 
        else 
           { Write-Host "NotLocalDisk"
            Exit}
    }
 }
 Write-Host "DriveNotFound"

We can see requirements evaluation in the log. The log shows that Powershell script was executed and value LocalDisk was returned. Hence the requirement was met in our case.

Here are the excerpts from IntuneManagementExtension log for Check Extended requirements.

<![LOG[[Win32App] ===Step=== Check Extended requirement rules]LOG]!><time="21:44:06.4435116" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] ProcessRequirementRules starts]LOG]!><time="21:44:06.4445104" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] ProcessRequirementRules Parsing InstallEx...]LOG]!><time="21:44:06.4465216" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] RequirementType 3]LOG]!><time="21:44:06.4465216" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] Start requirementManager SideCarScriptRequirementManager]LOG]!><time="21:44:06.5614100" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] Requirement script file C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts\4c153c53-913e-4a75-92b1-27e53ca03876_1.ps1 is saved.]LOG]!><time="21:44:08.4243079" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG["C:\Program Files (x86)\Microsoft Intune Management Extension\agentexecutor.exe"  -powershellDetection  "C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts\4c153c53-913e-4a75-92b1-27e53ca03876_1.ps1" "C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts\4c153c53-913e-4a75-92b1-27e53ca03876_1.ps1quotedResultFilePath.txt" "C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts\4c153c53-913e-4a75-92b1-27e53ca03876_1.ps1quotedErrorFilePath.txt" "C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts\4c153c53-913e-4a75-92b1-27e53ca03876_1.ps1quotedTimeoutFilePath.txt" 3600 "C:\Windows\System32\WindowsPowerShell\v1.0" 0 "C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts\4c153c53-913e-4a75-92b1-27e53ca03876_1.ps1quotedExitCodeFilePath.txt" False]LOG]!><time="21:44:08.9273914" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] SideCarScriptRequirementManager create files for outputs]LOG]!><time="21:44:08.9273914" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] SideCarScriptRequirementManager Launch powershell executor in machine session]LOG]!><time="21:44:08.9313818" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] SideCarScriptRequirementManager Create proxy process successfully.]LOG]!><time="21:44:09.1625970" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] SideCarScriptRequirementManager process id = 10236]LOG]!><time="21:44:09.1636001" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] SideCarScriptRequirementManager Powershell execution process timeout milliseconds: 3600000.]LOG]!><time="21:44:09.1636001" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] SideCarScriptRequirementManager Execution is done, collecting result]LOG]!><time="21:44:34.4877644" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] SideCarScriptRequirementManager Powershell execution got lpExitCode: 0 lastWin32Error: 0]LOG]!><time="21:44:34.4887625" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] SideCarScriptRequirementManager Powershell ExitCode: 0]LOG]!><time="21:44:35.1416076" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] Requirement script file C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts\4c153c53-913e-4a75-92b1-27e53ca03876_1.ps1quotedExitCodeFilePath.txt is deleted.]LOG]!><time="21:44:35.1427095" date="4-17-2022" component="IntuneManagementExtension" context="" type="1" thread="3" file="">
<![LOG[[Win32App] Checked Powershell script result: LocalDisk


Related Posts

Subscribe to Techuisitive Newsletter

Be the first to know about our new blog posts. Get our newsletters directly in your inbox and stay up to date about Modern Desktop Management technologies & news.

1 thought on “Understanding Win32 App Requirements Rule in Microsoft Intune”

  1. App with requirements defined are not getting installed during the Autopilot process.
    They are assigned in ESP as blocked app and assigned to the dynamic device group.

    IME log says that the requirement was checked and met, still the app is not installed in Autopilot process.

Leave a Comment

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

Scroll to Top