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

Disable accounts specified in DN syntax property

May 04, 2023 Views: 269

The script disables the accounts specified in a DN syntax property of the target object. The script can be executed in business rules, custom commands and scheduled tasks.


  • $propertyName - Specifies the directory schema name of the property to obtain accounts for disabling from.
  • $pipelined - If set to $True, disabling the accounts will be passed through Adaxes pipeline to apply configured workflows (e.g. trigger corresponding business rules, create a log record in Adaxes for each update).
Edit Remove
$propertyName = "seeAlso" # TODO: modify me
$pipelined = $True # TODO: modify me

# Get property values
    $DNs = $Context.TargetObject.GetEx($propertyName)
    $Context.LogMessage("<TEXT>", "Information")

# Disable accounts
foreach ($DN in $DNs)
    $account = $Context.BindToObjectByDNEx($DN, $pipelined)
    $account.AccountDisabled = $True
Comments 0
Leave a comment

Got questions?

Support Questions & Answers