0 votes

We have a business rule that will update an AD attribute when a new member is added to a group. This business rule works when we use powershell commands or the admin console but it seems to not be triggering for an ADSI script.

$groupDN = (Get-AdmGroup -Identity $Name).DistinguishedName
$group = $Context.BindToObjectByDN($groupDN)
$group.Add("Adaxes://$user")

That is the code that we are using to add the member to the group which is not triggering the business rule. It is adding the member to the group though. The business rule is set to trigger "After adding a member to a group".

Thank you for your support!

by (2.3k points)

1 Answer

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

Hello Mark,

The behavior is expected as you are binding to the group bypassing Adaxes pipeline. To achieve the desired behavior, use method $Context.BindToObjectByDNEx:

$groupDN = (Get-AdmGroup -Identity $Name).DistinguishedName
$group = $Context.BindToObjectByDNEx($groupDN, $True)
$group.Add("Adaxes://$user")
0

Thank you!

Related questions

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.5k 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
1 answer

I need a way of triggering a business rule based on the user (and not the group) being added or removed from a group. The reason I would like this triggered on the user is so ... prefer not to do that. I am checking to see if there is another way to do this.

asked May 16, 2023 by mark.it.admin (2.3k points)
0 votes
1 answer

I have created a Business Rule (call it BR1) that occurs After adding or removing a member from a group . For testing purposes, it currently runs a PowerShell script ... the Business Rule I created. Is this expected behavior? Or am I doing something wrong?

asked Apr 12, 2023 by alex.vanderwoude (60 points)
0 votes
1 answer

Is there any way to add a warning message when someone tries to add a group member that already is member? Checked config but found nothing related. Added a new member that ... the group and there is no warning, and the logs show that the task was completed.

asked Jul 9 by lramirez (20 points)
3,541 questions
3,232 answers
8,225 comments
547,799 users