0 votes

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

0 votes
by (18.0k points)
selected by
Best answer

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
}
0

Thanks it works fine ;)

Related questions

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

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

I'm trying to combine these two scripts to effectively store a user's group memberships in customattributebinary5 and then be able to copy and paste those memberships to a ... ) $Context.LogMessage("Added the user to group '$groupName'", "Information") }

asked Jan 24, 2020 by yourpp (540 points)
0 votes
1 answer

Hi, I need to create a number of mail user accounts via Adaxes and a lot of these accounts have & in the displayname/email address etc (I know, I know ... failed so I can troubleshoot it better. I have tried $context.logmessage($_.Exception.Message) Thanks

asked 2 days ago by typod (50 points)
0 votes
1 answer

I have 18 domains managed by Adaxes and have noticed that Admin (full access) t all objects acts normally, but for piecemeal scopes like Service Desk that scopes to individual ... role (including 16 denies) and expect it to grow as we add more domains.

asked Sep 20, 2022 by DA-symplr (80 points)
3,365 questions
3,064 answers
7,815 comments
545,281 users