Now Loading

Proget Console

Proget Query Language (PQL)

Proget Query Language (PQL) is a simple query language that allows you to filter devices in your system. With PQL, you can dynamically assign devices to groups based on defined criteria, creating so-called dynamic groups. Previously, groups were static – administrators manually assigned devices to groups. Now, with PQL, groups can automatically include devices that meet certain conditions, such as device data or user labels. It is also possible to combine different criteria within a single query.

Dynamic grouping allows the configuration to be pre-prepared and automatically assigned to devices, even if they are not yet present in the system. The configuration can be modified based on user attributes taken from external directories such as Active Directory. Changes made to the directory can automatically affect the configuration of devices in the Proget system.

With PQL, it is easy to create device groups without having to manually assign them. If you do not use the advanced features of PQL, the default group creation mechanism will automatically create a label for the group. For compatibility with previous versions of the system, simply assign the user a label with the same name as the group.

PQL'
1 No devices
  • Empty group to which no devices will be assigned
2 All devices
  • Automatically included all devices in the system
3 Custom settings
  • Allows the creation of PQL filters based on specific criteria

Custom settings

In the “Custom Settings” section, the administrator can create PQL filters using the available parameters. The system prompts for available options when typing, making query creation intuitive. When the syntax is correct, the administrator can see a list of devices that meet the filter conditions, facilitating ongoing verification of the results.

To better understand the syntax of the filters, here are some basic concepts:


Key elements of the PQL filter

  • Phrase
    • A single expression consisting of a parameter, operator and value
    • Each filter must contain at least one phrase
    • Phrases can be combined using logical operators (AND, OR)
  • Parameter
    • Specifies the attribute of the device or its owner that is being filtered
  • Operator
    • Combines a parameter with a value and defines the relationship between them
  • Value
    • The right-hand side of an expression, specifying what we are looking for (e.g. text, number, logical value)
  • Connector
    • Combines phrases into more complex queries
    • Available connectors: AND, OR

  • Examples of filters

    PQL_OS_TYPE'
    1 device.os.type = android
    • This filter assigns all Android devices to a group

    PQL_LABEL'
    1 device.user.label != Employee
    • This filter includes all devices whose owner does not have the label “Employee”

    PQL_ORGANIZATION_UNIT'
    1 device.user.organizationUnit contains Office AND device.user.isBlocked = false AND device.os.type = android
    • This filter combines several criteria:
      • The device belongs to a user whose organisation unit (value synchronised with the directory service) contains the word “Office” in its name
      • The device user is not blocked in the Proget system
      • The device runs on Android

    Keys

    Keys Available operators Value type Description
    device.manufacturer =, != enum Device manufacturer, e.g. Samsung
    device.model =, != enum Device model, e.g. iPhone 13
    device.serialNumber =, != text Device serial number
    device.progetId =, != text Device Proget ID, e.g. 123 456
    device.os.type =, != enum Device operation system e.g. Android
    device.os.versionCode =, != number Device operation system version e.g. 33 (Android 13)
    device.activationType =, != enum Activation type e.g. android_mdm
    device.systemUpdateStatus =, != enum Value from a defined set, e.g. available
    device.SIM1.IMEI =, != text IMEI for SIM1
    device.SIM2.IMEI =, != text IMEI for SIM2
    device.SIM1.ICCID =, != text ICCID for SIM 1
    device.SIM2.ICCID =, != text ICCID for SIM2
    device.SIM1.carrier =, != text SIM1 operator
    device.SIM2.carrier =, != text SIM2 operator
    device.mdmVersionCode =, !=, >, >=, <, <= number Proget app version code
    device.alias =, !=, contains, not_contains, starts_with, not_starts_with text Device alias
    device.user.uuid =, != text User UUID
    device.user.isBlocked =, != bool Device belonging to a blocked user
    device.user.email =, !=, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with text User email e.g. jdoe@example.com
    device.user.type =, != enum User type e.g. local
    device.user.displayName =, !=, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with text Name and surname e.g. John Doe
    device.user.username =, !=, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with text Username e.g. jdoe
    device.user.principalName =, !=, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with text User principal name e.g. jdoe@example.com
    device.user.distinguishedName =, !=, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with text User distinguished name (DN)
    device.user.commonName =, !=, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with text User common name
    device.user.organization =, !=, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with text User organization
    device.user.organizationUnit =, !=, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with text User organization unit
    device.user.locacity =, != text Locacity
    device.user.tittle =, !=, contains, not_contains, starts_with, not_starts_with, ends_with, not_ends_with text User tittle
    device.user.label =, != text User label



    Operators

  • = – comparison (equals)
  • != – comparison (not equal)
  • < – comparison (less than)
  • <= – comparison (less than or equal)
  • > – comparison (greater)
  • >= – comparison (greater than or equal)
  • contains – contains a specific fragment of text
  • not_contains – does not contain a specific fragment of text
  • starts_with – starts with a specific fragment of text
  • not_starts_with – does not start with a specific fragment of text
  • ends_with – ends with a specific fragment of text
  • not_ends_with – does not end with a specific fragment of text

  • Value types

  • text – e.g. “SAMSUNG”. Multi-word values should be enclosed in inverted commas
  • number – e.g. integer or floating point
  • bool – bool value (true or false)
  • enum – a value from a defined set, e.g. type of operating system