0 votes

I'm wondering if there are any recommended ways to do this in Adexes as part of the deprovisioning or mover process?

For example....

When de-provisioning any user, check, using a script, to see if they have any direct reports.
If so,
. Generate a list of the direct reports
. Prompt the initiator to select the new manager
. Reassign the 'manager' attribute of each direct report to the new manager
. Continue de-provisioning

However I'm not sure if that kind of interaction with the initiator is possible

Any ideas on how to do this please?


by (310 points)

1 Answer

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

Hello Bernie,

Unfortunately, there is no possibility to have such an interaction. As a solution, you can use an AD object picker parameter in your deprovisioning Custom Command. The parameter will specify a user that will be set as manager for direct reports of the deprovisioned account if it has any. To update the manager, use the below script. In the script, the $newManager variable specifies the name of the Custom Command parameter used to specify the new manager with the param- prefix.

$newManager = "param-NewManager" # TODO: modify me

# Get new manager DN
$newManagerDN = $Context.GetParameterValue($newManager)

# Get user subordinates
$subordinateDNs = $Context.TargetObject.GetEx("directReports")

# Update manager for subordinates
foreach ($subordinateDN in $subordinateDNs)
    $subordinate = $Context.BindToObjectByDN($subordinateDN)

    # Update manager
    $subordinate.Put("manager", $newManagerDN)

    # Save changes

The Custom Command will look like the following:

For information on how to use parameters in Custom Commands, have a look at the following tutorial: https://www.adaxes.com/tutorials_Active ... ommand.htm.


That will work for us - many thanks!


Related questions

0 votes
1 answer

Is it possible, using a business rule, to reassign a user's direct reports to their manager when they get disabled? For example, User B reports up to User A. User B gets disabled and all of their direct reports automatically get assigned to User A. Thanks

asked Jul 6, 2020 by bavery (250 points)
0 votes
1 answer

Is is possible through Security Roles, or some other mechanism, to allow managers to be able to edit Active Directory data (through the Web Interface) for only their direct reports and no other users?

asked Mar 23, 2015 by yobhod (150 points)
0 votes
1 answer

We have the following script we need fixed to run within Adaxes to add true/false value to a customattribute for use in building dynamic distribution lists. $users = ... } else { Set-Mailbox -Identity $user.Name -CustomAttribute8 "Individual contributor" } }

asked Jul 13 by willy-wally (3.2k points)
0 votes
1 answer

If a user is disabled, I would like the following process to be automated: Direct reports of this disabled user (user A) are reassigned to new active user (user B) who ... is sent to User B indicating User As direct reports have been transferred to User B

asked Apr 29 by Cavolick (60 points)
0 votes
1 answer

We would like to use the "Rule Based Groups" functionality that Adaxes has to create distribution groups where we have one group per manager and the members are the user ... so that the link doesn't break when changes happend to the managers AD object?

asked Oct 27, 2021 by odsven (1.8k points)
2,797 questions
2,530 answers
56,813 users