Package & Step Conditions

PDQ Connect supports the use of conditions to control whether a package or an individual step should run on a target device. Conditions provide flexibility by allowing you to define specific criteria that must be met before execution.

If a condition is not met, the associated step or package will be skipped.

Overview

Conditions are designed to handle scenarios or configurations that require special handling, such as skipping an uninstall step when the software is not installed or preventing a device reboot when a user is actively logged in. This approach eliminates the need to create separate packages and groups for each unique scenario.

Unless otherwise noted, conditions are evaluated at the time the package runs. It is not necessary to scan the machine before running the package if recent changes have been made, as they will be checked while the package is running. 

Currently, conditions are only supported for Windows based OS's. Support for MacOS will come at a later date.

Condition Levels

Conditions can be applied at two levels:

  • Package Level: Determines if the entire package runs.
    • Package level conditions are evaluated first. If the package level condition is false, the package does not run at all. If the condition is true or if no package level condition is defined, the process moves on to step level conditions. Package level conditions may be set on the "Properties" tab of a package.
    • If a package level condition is not met, the deployment will stop and display a status of Canceled. In the status column, you’ll see details indicating which condition failed. These details will begin with: Package condition not met.
  • Step Level: Determines if an individual step runs within the package.
    • Step level conditions are evaluated individually for each step. By default, if a step’s condition evaluates to false, that step is skipped and the package continues to the next step. 
    • If you wish to stop running the package without moving on to additional steps, check the box next to "Stop running package if conditions are not met." 
    • If a step-level condition is not met, the details are recorded in the output log. Unlike package level conditions, this does not result in a cancellation. Even if no steps run due to package conditions not being met, the overall package status will still end in Complete as long as no steps failed outright. 

Adding Multiple Conditions

You can define multiple conditions at both the package and step levels. Click the Add condition button then select an operator, then repeat for additional conditions. The available logical operators are AND and OR.

Conditions do not support filter groups, which means you cannot mix operators within the same package or step.

  • If you select AND, all conditions added will also use AND.
  • If you select OR, every condition will use OR.
  • It is not possible to combine AND and OR conditions in the same package or step.

Available Conditions

The following conditions are supported:

  • Group membership - Check if the device belongs to a specific PDQ Connect group.
  • OS Version - Validate the operating system version before running the package or step.
  • Logged-on user - Checks if a user is logged in or not before execution.
  • Files & folders - Verify the presence or absence of files.
  • Registry - Check for specific registry keys or values.
  • Service - Confirm whether a service is running or not.
  • Process - Validate if a process is active or not.

Group Membership

The group membership condition allows you to control whether a package or step runs based on the device’s membership in a PDQ Connect group. You can select the group from a dropdown list, which includes all groups configured within the organization or tenant where the package was created.

Important: Group membership is captured at the time the deployment is created.

OS Version

The OS version condition allows you to target deployments based on the operating system of the device. The OS list is predefined and includes operating systems currently supported by Microsoft and PDQ Connect. Windows editions that have reached end of life such as Windows 7 or Server 2012 are not available. Some of the options you can select include:

  • All servers
  • All workstations
  • Specific server or workstation versions. 
  • Windows 10 (any version) or Windows 11 (any version)

Logged-on User

The logged-on user condition allows you to specify if a package or step should run based on if a user is actively logged into the machine or not. 

This condition does not apply to Remote Desktop connections. If a user is connected to a device using RDP, the condition will be processed as if no user is logged into the device. 

Files & Folders

The files & folders condition allows you to use the existence of a file as a deployment condition. There are a few important considerations:

You must specify the file extension. Omitting the extension will prevent the deployment from detecting the file, even if it exists.

  • This condition applies to files only. It is not currently possible to create a condition based on the existence of a folder.  
  • You do not need to create a custom Files & Folders scanner for this condition to work. The deployment checks for the file directly on the machine during execution.
  • You can enable the Search sub-folders option to look for the specified file within all subfolders under the specified path.

Registry

The registry condition allows you to use the existence of a registry key as a deployment condition. It's important to understand what this condition considers as criteria. 

The registry condition only works with registry keys. It does not work with registry values or value data. 

  • A registry key is considered part of the registry path, whereas a registry value represents an object such as a DWORD or String value. For example:


     
  • You can enable the Search sub-keys option to check for the specified key within child registry keys under the specified key. 

Service

The service condition determines whether a package or step runs based on the running status of a specified service. You can configure the condition to execute the step when the service is either running or not running. Supported operators are: Contains, Equals, and Starts With.

The service condition uses the service’s display name, not its internal service name. The display name may be verified using the Get-Service PowerShell Command. 

Process

The process condition determines whether a package or step executes based on the status of a specified process. Similar to the service condition, the supported operators are Contains, Equals, and Starts With

The process condition uses the process name, not its display name or description. The process name can be confirmed using the PowerShell command Get-Process. 

In addition to checking whether a process is running or not running, this condition also supports evaluating if the process is suspended or not responding.

Summary

Conditions provide powerful flexibility in deployment workflows by allowing actions to be executed only when specific criteria are met. Whether targeting based on OS version, logged-on user status, file existence, registry keys, services, or processes, these conditions help streamline deployments and reduce the need for complex package structures.

Was this article helpful?