Script repository

Updated on: Jan 18, 2026, Views: 5055

Managers and subordinates

The script updates the adm-ManagedByList property with values of msExchCoManagedByLink. To execute the script, create a custom command, business rule or scheduled task configured for the User object type.

$allDNs = New-Object "System.Collections.Generic.HashSet[String]"

try
{
    # Get msExchCoManagedByLink property values
    $exchangeOwners = $Context.TargetObject.GetEx("msExchCoManagedByLink") | %%{[void]$allDNs.Add($_)}
}
catch
{
    # The msExchCoManagedByLink property is empty
}

try
{
    # Get Adaxes secondary owners
    $adaxesOwners = $Context.TargetObject.GetEx("adm-ManagedByList") | %%{[void]$allDNs.Add($_)}
}
catch
{
    # The adm-ManagedByList property is empty
}

# Update Adaxes secondary owners
$Context.TargetObject.Put("adm-ManagedByList", @($allDNs))
$Context.TargetObject.SetInfo()

Comments 0

You must be signed in to comment.

    Got questions?

    Support Questions & Answers

    We use cookies to improve your experience.
    By your continued use of this site you accept such use.
    For more details please see our privacy policy and cookies policy.