0 votes

Hello,

I am attempting to configure a business rule that adjusts an adaxes custom property of a user, upon that user being added/removed from a group. I cannot seem to find the right way to go about this. I have tried setting it up from the group perspective, and using the %adm-memberUserName% to pull the user and my target custom variable I wish to change is %adm-CustomAttributeBoolean20%, but I cannot get anything to interact with or change this variable. I am not sure how to reference a custom variable properly when trying to adjust it based on my criteria above. Can support/anyone help me? What is the proper way to reference custom values so I may manipulate them when scripting in powershell? I apologize if this is in your FAQs or Documentation, I cannot find it. There is plenty on referencing normal values, (like username, office, description, email, etc.) but not so much on custom attributes.

by (70 points)

1 Answer

0 votes
by (272k points)

Hello,

Value references work the same for all types of objects and properties. The following article should be helpful: https://www.adaxes.com/help/ValueReferences. At the same time, you need to pay attention what the target object is. In your case, it is a group, not the member being added. The behavior is by design and comes from AD. The thing is that when you add/remove a member from a group, it is the group being updated, not the member. As such, if you need to update a property of a member being added to a group in your business rule, you should have a script like below. In the script:

  • $propertyToUpdate - Specifies the name of the property to update for the member.
  • $propertyValue - Specifies the value to be set for the member property.
$propertyToUpdate = "adm-CustomAttributeBoolean20" # TODO: modify me
$propertyValue = $True # TODO: modify me

# Bind to the member
$member = $Context.BindToObject("Adaxes://%member%")

# Update member
$member.Put($propertyToUpdate, $propertyValue)
$member.SetInfo()

Related questions

0 votes
1 answer

I have a scheduled task that runs a Powershell script against an AD group, "Group 1". I need to get all of the members of Group 1, and add them to Group 2. The ... identity in the error message start with 'user;'? What is the correct way to accomplish this?

asked Aug 27, 2019 by ngb (220 points)
0 votes
1 answer

We currently have a form for HR to deal with ex-employees that are hired once more, but it's not much more than automatic emails sent to IT. If I add some actions ... this trigger the business rule we have that targets "After updating a user" ? Thanks, Louis

asked Oct 18, 2022 by lw.fa (130 points)
0 votes
0 answers

I have a Business Rule that is suppose to remove a User from a Universal Distribution Group based on a DN Group Template string ("CN=%division% List,%adm-ParentDN%") but despite it ... , it is correct and the group exists. I don't know what else to check.

asked Jun 4, 2019 by Staj (350 points)
0 votes
1 answer

Hi team, I have a follow up to this question https://www.adaxes.com/questions/14234/business-after-adding-members-powershell-script-executed Let me explain my setup A rule- ... area% failed due to the following exception: $($_.Exception.Message)", "Error") }

asked Feb 13 by wintec01 (1.1k points)
0 votes
1 answer

I have a Rule-Based group with users. Every time a users gets added or removed from this group I want to trigger a Business Rule for "Atter adding or removing a member ... Rules be triggered by a Rule-Based group adding or removing a user? Morten A. Steien

asked Mar 27, 2023 by Morten A. Steien (300 points)
3,351 questions
3,052 answers
7,791 comments
545,084 users