INextOperationReason
The INextOperationReason interface allows specifying a reason for the next operation.
Methods
-
Method
-
Description
-
SetReason()
-
Sets the reason for the operation.
Details
SetReason()
Sets the reason. The reason will be included with the next operation on the object. For example, when either SetInfo or SetPassword is called to commit the changes to the directory.
void SetReason(OperationReasonInfo value)
Parameters
- params – details about the operation reason.
Examples
The following code sample changes the user's job title and provides a reason that justifies a title change.
Import-Module Adaxes
# Connect to the Adaxes service.
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly("localhost")
# Bind to the user.
$userPath = "Adaxes://CN=John Smith,CN=Users,DC=domain,DC=com"
$parent = $service.OpenObject($userPath, $null, $null, 0)
# Update the user's title.
$user.Put("title","Sales Manager")
# Specify the operation reason.
$reason = [Softerra.Adaxes.Adsi.OperationReasonInfo]::new(
"Title change required after promotion.", # Field value
"Reason" # Field label
)
$user.SetReason($reason)
# Save the changes to the directory.
$user.SetInfo()
Requirements
Minimum required version: 2026.2