Script repository
The script returns $true if an object is moved to the specified Organizational Unit or container. To execute the script, use the If PowerShell script returns true condition in a business rule triggering Before moving an object.
In the script, the $containerDN variable specifies the distinguished name (DN) that should match the target container DN for the condition to be met. For information on how to get the DN, see Get the DN of a directory object.
$containerDN = "OU=Disabled Accounts,DC=company,DC=com" # TODO: modify me
# Get target container DN.
$targetContainer = $Context.Action.TargetContainer
if ($targetContainer)
{
$targetContainerDN = $targetContainer.Get("distinguishedName")
}
else
{
$targetContainerDN = $Context.Action.TargetContainerDnTemplate
}
$Context.ConditionIsMet = $targetContainerDN -eq $containerDN
Comments 0
You must be signed in to comment.