Skip to main content
Skip to main content

Universal App Requirement Rules

Audience: Platform Engineering, app deployment administrators

Purpose: Ensure applications deploy correctly across shared, kiosk, and personal devices


Overview

This procedure configures universal requirement rules for applications in Microsoft Intune to ensure:

  • Required apps assigned directly to shared devices install correctly
  • User-assigned required apps don't auto-install on shared devices
  • Ownership and user-based restrictions are respected on personal devices

Key Concepts

TermDefinition
Requirement RulesConditions that must be met before an application installs
Shared Device ModeMulti-user environment configuration (labs, classrooms)
Kiosk ModeSingle-purpose device restriction
Primary UserUser assigned during enrollment or set in Intune
Exit 0App can install
Exit 1App installation blocked

Shared Device Filter

Use a filter to exclude non-user enrolled devices:

PropertyValue
Filter NameShared Device - Filter
Filter Query(device.enrollmentProfileName -ne "_TAMU User Driven with Pre Provision")

This filter ensures only non-user-enrolled devices (kiosks, shared PCs) are included when needed.


Scope Group Strategy

Leverage Policy Scope Groups (PSGs) for application assignment:

  • PSGs organize assignments by unit or infrastructure needs
  • ESGs define user and device-level assignments
  • Apply filter to PSGs to include/exclude non-user devices

Requirement Script

The following PowerShell script determines installation based on device type and ownership:

# Step 1: Detect if the device is a shared device
$SharedDevice = $false
try {
$SharedDevice = (Get-WmiObject -Namespace root\cimv2\mdm\dmmap -Class MDM_SharedPC).IsShared -eq $true
} catch {
$SharedDevice = $false
}

# Step 2: Detect if the device is in Kiosk mode
$KioskMode = $false
try {
$KioskMode = Test-Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\AssignedAccessConfiguration"
} catch {
$KioskMode = $false
}

# Step 3: Get the primary user and current user
$PrimaryUser = (Get-WmiObject -Namespace root\cimv2\mdm\dmmap -Class MDM_DevDetail_Ext01).PrimaryUser
$CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name

# Step 4: Apply installation rules
If ($SharedDevice -or $KioskMode) {
Write-Output "Device is Shared PC or Kiosk mode. Allowing installation."
Exit 0
} ElseIf ([string]::IsNullOrEmpty($PrimaryUser)) {
Write-Output "Device has no primary user. Allowing installation."
Exit 0
} ElseIf ($CurrentUser -eq $PrimaryUser) {
Write-Output "Current user is the primary user. Allowing installation."
Exit 0
} Else {
Write-Output "Current user is not the primary user. Blocking installation."
Exit 1
}

Script Logic

ConditionResult
Shared Device or Kiosk ModeAllow — Direct device assignment
No Primary UserAllow — Unassigned device
Current User = Primary UserAllow — User owns device
Current User ≠ Primary UserBlock — Prevent cross-user install

Configuration Procedure

Step 1: Prepare the Script

Save the PowerShell script to a .ps1 file for upload to Intune.

Step 2: Configure Requirement Rule

  1. Navigate to Intune Admin Center → Apps → All Apps
  2. Select the target application
  3. Go to Properties → Requirements → Edit
  4. Add a new requirement rule:
SettingValue
Rule TypeCustom Script
Output Data TypeInteger
OperatorEquals
Value0
  1. Upload the PowerShell script
  2. Save the configuration

Step 3: Assign the Application

Configure assignments based on deployment needs:

Device TypeAssignment TargetFilter
Shared DevicesDevice groupsNone (or include shared devices)
Personal DevicesUser groupsExclude shared devices
BothPSG with ESG membersApply filter appropriately

Step 4: Validate Deployment

Test on various device types:

Device TypeExpected Behavior
Shared deviceApp installs directly
Kiosk deviceApp installs directly
Personal device (primary user logged in)App installs
Personal device (non-primary user)App blocked

Step 5: Monitor

  • Apps → App Install Status — Check deployment status
  • Device logs — Review IntuneManagementExtension.log
  • Adjust script for edge cases as discovered

PatchMyPC Integration

For organizations using PatchMyPC:

  • Apply the requirement rule universally across managed applications
  • Ensures consistent logic across all app deployments
  • Reduces per-app configuration overhead