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?