Hi,
is it possible to combine conditions with AND and OR in one action?

For example:
if the Operation succeeded AND
the 'Department' property equals 'Marketing' OR
the 'CustomAttributeText1' equals 'Yes' then

Action

thank you in advance,

Napoleon

by (700 points)

1 Answer

by (18.0k points)
Best answer
0 votes

Update 2018

Starting with Adaxes 2018.1 it is possible to have Else If and Else blocks in business rules, custom commands and scheduled tasks. This way you can have conditions combined the way you need. For examples, have a look at section Else If and Else Blocks of the following tutorial: https://www.adaxes.com/tutorials_AutomatingDailyTasks_AutomateUserProvisioning.htm.

Original

Hello,

Currently it is impossible to combine conditions with AND or OR operators. However, you can use the If PowerShell script returns true condition.


Here is the script for the condition:

$Context.ConditionIsMet = $False
try
{
    $department = $Context.TargetObject.Get("department")
}
catch
{
    $department = $NULL
}

if ($department -ieq "Marketing")
{
    $Context.ConditionIsMet = $True
    return
}

try
{
    $value = $Context.TargetObject.Get("adm-CustomAttributeText1")
}
catch
{
    $value = $NULL
}

if ($value -ieq "Yes")
{
    $Context.ConditionIsMet = $True
}
by (700 points)
0

Thanks it works fine ;)

Related questions

This issue may occur when activating a Microsoft 365 account for a user and assigning licenses in the same action. Symptoms The following error is returned: License assignment ... a program or PowerShell script action that adds a 1-minute delay between them.

asked 2 days ago by Adaxes (660 points)
0 votes
0 answers

Hi, I am wondering how cloud connections should be handled across scripts for things to run as smooth as possible. For example, if I disconnect from Graph in ... ) $null = Connect-MicrosoftTeams -AccessTokens @($graphToken, $teamsToken) } Best regards, Martin

asked Mar 14, 2025 by Martin (190 points)
0 votes
1 answer

My scheduled task works like this (these are my action sets) Condition(s): Account is expired and home drive exists Action The user's home directory gets archived Condition(s): ... set? I do not want to split the scheduled task into two! Thanks in avance!

asked Apr 7, 2022 by lehnen (20 points)
0 votes
1 answer

Hi so if I have the web-interface setup on my internal server where I did the full install but I also have setup a RODC in DMZ how can I "merge" so that the URLS given ... get the offline/unlock that shows up to link and show/work for the web server on the DMZ

asked Nov 4, 2024 by ckelley (60 points)
0 votes
1 answer

Hello, How it works if I have multiple accounts in one domain, and other accounts in others domains managed by Adaxes ? Thank you. Regards. Pierre

asked Jun 9, 2021 by pierre.saucourt (40 points)
0 votes
1 answer