Script repository
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$trueto pass the update through Adaxes pipeline to create log records, apply business rules, security roles, etc. Set to$falseto 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.