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.

Script Repository

May 06, 2024 Views: 42

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.

Edit Remove
PowerShell
$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
    return
}

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
Leave a comment
Loading...

Got questions?

Support Questions & Answers