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: |
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
‘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.