0 votes

I have a custom command that is as follows

If Job Title property Contains "Director" OR
If Job Title property Contains "Assistant"
Add the user to the "CN=yadda/yadda/Directors" Group*

If the user is a member of the "CN=yadda/yadda/Directors" group AND 
the Job Title property Does Not Contain "Director"
Remove the user from the "CN=yadda/yadda/Directors" Group
Else If
If the user is a member of the "CN=yadda/yadda/Directors" group AND 
the Job Title property Does Not Contain "Assistant"
Remove the user from the "CN=yadda/yadda/Directors" Group

Now with that logic if a User with the title "Regional DIrector" is NOT in the group, and run the command, it will add the user to the group no problem.

BUT, If I run the command again on this same user, no changes, it will come back with that it Added the user to the group and the Removed the user from the group. I cannot for the life of me understand what is triggering the remove.

I want a simple logic to add a user to the group if the titles contain key words, keep the user in the group and basically ignore the command if they have the right title and are in the group, but remove the user if the titles do not match. What am I missing?

ago by (70 points)

1 Answer

+1 vote
ago by (299k points)

Hello,

The logic is absolutely correct. It does not work the way you expected because you split the two conditions about the job title property value in the second part. As such, for assistants, the conditions in the first part are met and for directors, those in the Else if block. The best approach in such cases is to use rule-based groups: https://www.adaxes.com/help/AddUsersToGroupsByDepartment/#dynamicgroups. If for some reason that is not an option, you can configure your custom command as follows:

image.png

0

We'll look into the Adaxes rule-based groups, but like having a command we can run against a particular user.

I tried with that logic in the screenshot and works flawlessly! Seeing the logical operation like that, makes a bit more sense why the original wasn't working.

Thank you very much for the quick support!

Related questions

+1 vote
1 answer

Hi, I were unable to find a publicly available information about release dates for the next Adaxes major version, including at https://www.adaxes.com/info_roadmap.htm. Since in my ... 's mid 2020 already, when can we expect a 2020.1 version please? Thank you.

asked Jun 16, 2020 by Denys (70 points)
0 votes
1 answer

I am trying to get a better understanding of how all this works, so forgive me if some of these questions don't make sense. We are trying to remove our final Exchange On ... to the cloud, then I would need to keep our last on-prem exchange server running?

asked Jan 9 by emeisner (120 points)
0 votes
1 answer

We noticed when renaming a user or changing the UPN it does not update in office365. I can change the username field by usign the following command from azure ... seamless task for our helpdesk? Can adaxes do this natively without a powershell script?

asked Oct 25, 2018 by huuchuan1113 (50 points)
0 votes
1 answer

We noticed when renaming a user or changing the UPN it does not update in office365. I can change the username field by usign the following command from azure ... seamless task for our helpdesk? Can adaxes do this natively without a powershell script?

asked Oct 21, 2014 by auser42 (340 points)
0 votes
1 answer

I have a report scheduled to run weekly with the following delivery options: There are 3 recipients on this report. For 2 of these recipients, the report is successfully ... following: But the email is still not delivered to that third recipient. Any thoughts?

asked Aug 21, 2024 by msinger (210 points)
3,634 questions
3,322 answers
8,398 comments
548,765 users