Scense Administrator Guide

⌘K
  1. Home
  2. Docs
  3. Scense Administrator Guid...
  4. Scopes and Criteria
  5. Creating and Managing Custom Criteria

Creating and Managing Custom Criteria

 

Scense allows the administrator to add custom Criteria to the Criteria Selector to be used in all Scopes. Creating custom Criteria is a powerful way of extending the functionality of the Scense system.

Manage Criteria

The Manage Criteria window can be opened using the ‘Manage Criteria’ option in the ‘System’ tab of the Scense Explorer ribbon.

This Window shows all available Criteria and enables the administrator to view, copy, edit, create and remove Criteria.

The Criteria that are ‘in use’ are rendered ‘bold’.

As mentioned before, the Built-in Criteria cannot be modified nor removed, but they can be copied to a custom Criterion by clicking the ‘Edit’ button.

New Criteria can be created by clicking the ‘Add’ button.

After clicking the ‘Add’ button the ‘Criterion Builder’ window will show.

Importing and Exporting Criteria

The Manage Criteria window supports the importing and exporting of custom Criteria.

This makes it possible to backup or share custom Criteria.

The custom Criterion will be exported to an SCX-file with XML layout.

Built-in Criteria cannot be exported.

Custom Criteria

A custom Criterion can be created with the Criterion Builder

The Criterion Builder has three sections:
The header, which contains the Name Category and the Description of the Criterion.
The Conditions section which will describe the conditions and how they are tested.
And the Parameter section which describes the parameters and how they can be used.
The Criterion Name will show up in the Criterion Selector and the Category will determine where the Criterion is listed.
An existing Category can be chosen, or a new one can be specified.
A Criterion always has at least one Condition, otherwise there’s nothing to test. The Condition needs a description which will be shown in the Scope property page in the Criterion Configuration area.
The Function Type can be either Built-In or VB-Script.
Built-In functions are used by the Built-In Criteria.
Here’s the list of supported Built-In functions and their parameters:
Check if the current IP-Address is within the specified network address and subnet mask.
InSubnet(string networkAddress, string networkMask)
Checks if the specified registry key exists.
DoesRegistryKeyExist(string keyName)
Checks if the specified registry value exists.
DoesRegistryValueExist(string valuePath)
Checks how the specified registry value matches the specified value data.
DoesRegistryValueMatch(string valuePath, string valueData)
Checks if the specified registry value starts with the specified value data.
DoesRegistryValueStartWith(string valuePath, string valueData)
Checks if the specified registry value ends with the specified value data.
DoesRegistryValueEndWith(string valuePath, string valueData)
Checks if the specified registry value contains the specified value data.
DoesRegistryValueContain(string valuePath, string valueData)
Checks if the specified folder exists.
DoesFolderExist(string folderPath)
Checks if the specified file exists.
DoesFileExist(string filePath)
Checks how the modification date of the specified file matches the specified time stamp.
DoesFileDateMatch(string filePath, DateTime fileDate)
Checks how the version of the specified file matches the specified version.
DoesFileVersionMatch(string filePath, string fileVersion)
Displays a messagebox that asks the user to click either ‘yes’ or ‘no’.
UserQuestion(string question)
Checks if the specified Windows Installer product is inistalled.
IsMSIApplicationInstalled(Guid productGuid)
Checks if the specified variable exists.
DoesVariableExist(string variableName)
Checks how the specified variable value matches the specified value.
DoesVariableValueMatch(string variableName, string variableValue)
Checks if the specified variable value starts with the specified value.
DoesVariableValueStartWith(string variableName, string variableValue)
Checks if the specified variable value ends with the specified value.
DoesVariableValueEndWith(string variableName, string variableValue)
Checks if the specified variable value contains the specified value.
DoesVariableValueContain(string variableName, string variableValue)
Checks how the specified OS Attribute value matches the specified value.
DoesOSAttributeValueMatch(string name, string value)
Checks if the current user is a member of the specified Active Directory group.
IsMemberOfADGroup(string groupName)
Checks if the specified Active Directory group is the primary group for the current user.
IsPrimaryADGroupForUser(string groupName)
Checks if the current computer is a member of the specified Scense site.
IsMemberOfScenseSite(string site)
Checks if the current computer resides on the specified location.
IsComputerOnLocation(string location)
Checks if the specified SWV application is imported.
DoesSWVApplicationExist(string layerGuid)
Checks if the specified SWV application is activated.
IsSWVApplicationActivated(string layerGuid)
Checks if the specified App-V application is imported.
DoesAppVApplicationExist(string applicationName)
Checks if the specified App-V package is imported.
DoesAppVPackageExist(string packageGUID)
Checks if the specified ThinApp application is available.
DoesThinAppApplicationExist(string applicationGUID)
Checks how the specified Hardware Attribute value matches the specified value.
DoesHardwareAttributeValueMatch(string name, string value)
However, it is possible to use built-in function types it’s more likely that VB-Scripts will be used with custom criteria.
Please see the example on how to create a custom Criterion based on a VB-script.
A Parameter serves as input for the condition.

In built-in Criteria the parameters are input for the built-in functions.

Each parameter has a Name and an ‘Argument Name’.
The ‘Name’ will be visible in the user interface of the Scope property page and the ‘Argument Name’ will be used internally at runtime for passing the right parameter to the built-in function or VB-script.For each parameter a specific data entry method can be selected by choosing a Data Type.
There are several Data Types with their own data entry methods and browsers:
  • Active Directory Group shows a link and a browse button to open the standard Active Directory object browser and select a group.
  • Active Directory OU showsa link and a browse button to open the standard Active Directory OU browser and select an Organizational Unit.
  • Application data types like App-V Application Name, App-V Package Name, ThinApp Application Name, Virtual Layer Application Name and Windows Installer Application Name will show a link and a browse button to open the Application browser for the specified type.
  • Date will show a date and time selection.
    The built-in functions will treat this date as if it’s UTC (GMT+0).
  • File Name shows a text input and a browser. The fully qualified pathname can either be typed or browsed for.
  • File Version shows a free-form text field in which the version can be typed
  • Folder Name shows an input field and a browse button. The browse button will show the standard folder browser. Typing a location (e.g. hidden share) into the input field and next clicking the browse button will open the folder browser at the typed location.
  • IP Address will show a formatted IP or subnet input field.
  • Location will show a link and a browse button to open the Location tree browser.
  • Multiline String will show a text input field that accepts multiple lines. Pressing CTRL+Enter will start a new line.
  • Operating System Attribute and Hardware Attribute will show a link and a browse button to open the corresponding browser.
  • Registry Key will show a text input and a browser. The fully qualified pathname can either be typed or browsed for.
  • Registry Value shows a text input and a browser. The fully qualified pathname can either be typed or browsed for.
  • Scense Site will show a dropdown list of all sites in the Scense system
  • String shows a standard text input field.
  • Variable Name shows a text input and a browser. The variable name can either be typed or browsed for.

‘Data Range’ specifies the input validation using a regular expression (Regex).
The regex can be written in the input field or a larger regex code window can be openen by clicking the ‘Edit Regex’ button.
When configuring a Criterion the input will be validated using the regex.

If the value does not meet the format required by the regex then the input will be rejected.
The ‘Empty value allowed’ checkbox determines whether or not the user is required to specify a value for this parameter.