The script replaces values of a multi-valued property for the specified object with the values of the target object. To execute the script, create a custom command, business rule or scheduled task.
Parameters:
- $propertyName - Specifies the name of the property to process as it is specified in the directory schema.
- $targetObjectDN - Specifies the distinguished name (DN) of the object to update. For information on how to get an object DN, see https://www.adaxes.com/sdk/HowDoI.GetDnOfObject/.
- $pipelined - Specifies whether to pass the updates made by the script through the Adaxes pipeline to trigger business rules, apply property patterns, etc.
PowerShell
$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()