Script Repository


Check whether one of the Boolean properties is set to true

February 24, 2021
706

The script returns True if at least one of the specified Boolean properties is set to True. You can use the script in the If PowerShell script returns true condition in business rules, scheduled tasks and custom commands.

Parameter:

  • $properties - Specifies LDAP names of properties that should be checked.
Edit Remove
PowerShell
$properties = @("adm-CustomAttributeBoolean1", "adm-CustomAttributeBoolean2", "adm-CustomAttributeBoolean3") # TODO: modify me
$Context.ConditionIsMet = $False

foreach ($property in $properties)
{
    try
    {
        $value = $Context.TargetObject.Get($property)
    }
    catch
    {
        continue
    }
    
    if ($value)
    {
        $Context.ConditionIsMet = $True
        return
    }
}


Comments ( 0 )
No results found.
Leave a comment