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?

Thanks,
Bernie

by (310 points)

1 Answer

0 votes
by (272k 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
    $subordinate.SetInfo()
}

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.

0

That will work for us - many thanks!

Regards,
Bernie

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

Ideally looking to make this a rule based group, but report or business unit should work also. In our domain, service accounts become direct reports of the user who requested/ ... if a specific object is a/not a direct report. Is this possible? Thank you

asked Nov 14, 2023 by ThompsonAlex (40 points)
0 votes
1 answer

Hi, Is there a way I can create a rule based group or scheduled task in which the Direct reports of the direct reports are added to a group? So for example: CEO VP's ... in the list that no longer reports to a manager who reports to the CEO. Thanks in advance

asked Dec 22, 2022 by gareth.aylward (180 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, 2022 by willy-wally (3.2k points)
3,346 questions
3,047 answers
7,782 comments
544,984 users