Hello,
Yes, it is possible. You need to use the below script in a Run a Program or PowerShell script action in a Business Rule that triggers After disabling a user account. In the script, the $pipelined variable specifies whether the operation that changes the manager of direct reports should be passed through Adaxes pipeline, generating a log record for each manager update, triggering Business Rules, etc.
$pipelined = $False # TODO: modify me
# Get disabled user's manager and direct reports
$managerDN = $Context.TargetObject.Get("manager")
$subordinateDNs = $Context.TargetObject.GetEx("directReports")
# Replace manager of each subordinate
foreach ($subordinateDN in $subordinateDNs)
{
$subordinate = $Context.BindToObjectByDNEx($subordinateDN, $pipelined)
$subordinate.Put("manager", $managerDN)
$subordinate.SetInfo()
}
The Business Rule should also have two If <property> <relation> <value> conditions that check whether the disabled user has a manager and any direct reports. Finally, the rule should looks something like this: