Script repository

Copy multi-valued property values

Updated on: Jan 18, 2026, Views: 2522

Miscellaneous

The script replaces values of a multi-valued property for the specified object with the property values of the target object. To execute the script, create a business rule, custom command or scheduled task configured for the required object type.

Parameters

  • $propertyName - the name of the property to process as it is specified in the directory schema.
  • $targetObjectDN - the distinguished name (DN) of the object to update. For information on how to get an object DN, see Get the DN of a directory object.
  • $pipelined - set to $true to pass the update through Adaxes pipeline to create log records, apply business rules, security roles, etc. Set to $false to perform the update directly in AD (Adaxes functionality will not be applied).
$propertyName = "adm-ManagedByList" # TODO: modify me
$targetObjectDN = "CN=My group,OU=Groups,DC=company,DC=com" # TODO: modify me
$pipelined = $True # TODO: modify me

# Get property value
try
{
    $propertyValue = $Context.TargetObject.GetEx($propertyName)
}
catch
{
    $Context.LogMessage("Proeprty $propertyName is empty.", "Information")
    return
}

# Update object
$object = $Context.BindToObjectByDNEx($targetObjectDN, $pipelined)
$object.Put($propertyName, $propertyValue)
$object.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.