0 votes

Hello

I need some help to implement the following task:

In a business rule "Before adding a member to a group" an approval should be sent to the manager of the member who will be added to the group.

Do you have an example for this?

Thanks and greetings Pudong

by (560 points)
0

Hello Pudong,

It can only be done using a script. For us to provide you with the script, please, specify what should be done in case if the member being added does not have a manager. Any additional details will be much appreciated.

0

My business rule "Before adding a member to a group" includes two approval steps. The first approval should be sent to the member's manager. The second approval should be sent to the group owner.

The first step is to check if the manager and the group owner are present and active. If this is not the case, the action will be cancelled. Here it should be specially noted that the CEO does not have a manager, but the second approval step is in this case necessary.

if (member is CEO) do nothing else if  (the member has no manager or the manager is disabled) then show warning "Manager of member has no manager." Cancel Operation

If the Group Manager is empty or disabled then show warning "Group has no owner" Cancel Operation

The first approval step can be skipped if the member is the CEO. Can also be skipped if the member's manager and the group owner are the same. This is to avoid that the same person has to approve twice.

if member equal CEO OR manager of the member equal group owner then do nothing Else Send operation for approval to manager of group member

In the last step the approval is sent to the group manager. This action must always be performed.

Send operation for approval (Owner of the target group)

regards pudong

0

Hello Pudong,

Could you, please, post here or send us (support@adaxes.com) a screenshot of the business rule? Also, please, specify how exactly you determine whether a user is CEO& is it about some property value?

1 Answer

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

Hello Pudong,

Thank you for the provided details. Here are the scripts for your business rule.

Check if member manager is disabled

$Context.ConditionIsMet = $False

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

# Get member manager
try
{
    $managerDN = $member.Get("manager")
    $manager = $Context.BindToObjectByDN($managerDN)
}
catch
{
    return
}

$Context.ConditionIsMet = $manager.AccountDisabled

Submit for approval to the member manager

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

# Get member manager
try
{
    $managerDN = $member.Get("manager")    
}
catch
{
    $Context.LogMessage("%adm-MemberFullName% has no manager", "Information")
    return
}

# Submit for approval
$Context.SubmitForApproval(@($managerDN), $False, $False, $False, $False)
0

Hello Sorry for the late feedback, I needed some time to test the scripts. Everything works as desired :D Thanks a lot!

Related questions

0 votes
1 answer

Hello Adaxes Team You have already helped me to send an approval to the manager of a user. https://www.adaxes.com/questions/12406/send-approval-request-to-manager- ... to a group, DivManager1 should receive the approval request. thank you and greetings pudong

asked Jul 11 by pudong (560 points)
0 votes
1 answer

Hello, Is there a way to send an email notification when a user is added to a group dynamically (with LDAP filter) , it's work only when i add the user manually Thank you

asked Jun 30, 2021 by GG (70 points)
0 votes
0 answers

As the title mentions, I'm trying to figure out a way to have HR apply multiple modifications on a user's account (change of position, title, department, phone, etc...) ... phone number (in the same form), it sends two approval requests. Thanks for your help!

asked Jan 26 by lw.fa (60 points)
0 votes
1 answer

Our Help Desk currently 'mirrors' the group membership of a new user based on another existing user in our AD. I'd like to be able to automate this so that the initiator ... and 'paste' it on the new user being created. Any help on this would be appreciated!

asked Apr 21, 2020 by RayBilyk (220 points)
0 votes
1 answer

How can I allow manager of distribution group to edit just email aliases (proxy addresess) of that group? Not the primary SMTP address.

asked Nov 19, 2019 by KIT (520 points)
2,779 questions
2,512 answers
6,574 comments
26,122 users