We use cookies to improve your experience.
By your continued use of this site you accept such use.
For more details please see our privacy policy and cookies policy.

Script repository

Check whether one of the Boolean properties is set to true

February 24, 2021 Views: 2110

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
Leave a comment
Loading...

Got questions?

Support Questions & Answers