Intune Detection Rules

If you are uploading an application with a custom detection method, you can set the detection method as Windows Installer, File and folder, or Registry.

NOTE: The detection method is in JSON format and you'll need to use the format specified in this article's examples.

Windows Installer

Modifiable values:

  • productVersionOperator
    • notConfigured, equal, notEqual, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual
    • The operator to detect product version.
  • productCode
    • String value
    • Product code of the Windows installer
  • productVersion
    • String value
    • Value of the Windows installer

Example 1 - Windows installer product code

[{
    "@odata.type": "#microsoft.graph.win32LobAppProductCodeDetection",
    "productVersionOperator": "notConfigured",
    "productCode": "{57F514A0-50E6-463B-A1CB-F173B336F689}",
    "productVersion": "5.5.7"
}]

Example 2 - Windows installer product code with specific version

[{
    "@odata.type": "#microsoft.graph.win32LobAppProductCodeDetection",
    "productVersionOperator": "equal",
    "productCode": "{57F514A0-50E6-463B-A1CB-F173B336F689}",
    "productVersion": "5.5.7"
}]


File and folder

Modifiable values:

  • path
    • String value
    • Path to a folder containing the target file or folder. Use two backslash to differentiate folders
  • fileOrFolderName
    • String value
    • Name of the target file or folder
  • check32BitOn64System
    • true, false
    • A value indicating whether this file or folder is for checking 32-bit app on 64-bit system
  • detectionType
    • notConfigured, exists, modifiedDate, createdDate, version, sizeInMB, doesNotExist
    • The file system detection type
  • operator
    • notConfigured, equal, notEqual, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual
    • The operator to detect product version.
  • detectionValue
    • Value of the detection type

Example 1 - Folder exists

[{
    '@odata.type': '#microsoft.graph.win32LobAppFileSystemDetection',
    path: 'C:\\Program Files\\Google\\Drive File Stream',
    fileOrFolderName: '54.0.3.0',
    check32BitOn64System: false,
    detectionType: 'exists',
    operator: 'notConfigured',
    detectionValue: null
 }]

Example 2 - File version

[{
    "@odata.type": "#microsoft.graph.win32LobAppFileSystemDetection",
    "path": "C:\\Program Files\\Google\\Drive File Stream\\54.0.3.0",
    "fileOrFolderName": "GoogleDriveFS.exe",
    "check32BitOn64System": false,
    "detectionType": "version",
    "operator": "equal",
    "detectionValue": "54.0.3.0"
}]


Registry 

Modifiable values:

  • check32BitOn64System
    • true, false
    • A value indicating whether this registry path is for checking 32-bit app on 64-bit system
  • keyPath
    • String value
    • Path to a target registry key 
  • valueName
    • String value
    • The target registry value name
  • detectionType
    • notConfigured, exists, modifiedDate, createdDate, version, sizeInMB, doesNotExist
    • The registry data detection type
  • operator
    • notConfigured, equal, notEqual, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual
    • The operator for registry data detection
  • detectionValue
    • The registry detection value

Example 1 - Registry string value 

[{
    "@odata.type": "#microsoft.graph.win32LobAppRegistryDetection",
    "check32BitOn64System": false,
    "keyPath": "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\O365ProPlusRetail - en-us",
    "valueName": "DisplayVersion",
    "detectionType": "string",
    "operator": "greaterThanOrEqual",
    "detectionValue": "16.0.14931.20132"
}]

Example 2 - Registry value exists

[{
    "@odata.type": "#microsoft.graph.win32LobAppRegistryDetection",
    "check32BitOn64System": false,
    "keyPath": "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\O365ProPlusRetail - en-us",
    "valueName": "DisplayVersion",
    "detectionType": "exists",
    "operator": "notConfigured",
    "detectionValue": "null"
}]