There may be a requirement to use PowerShell to set a Control value using PowerShell.
In this example we will use OperationReason.
In order to pass the Control, it must be declared as Hash value in a pair.
In the below example it is $hash with the "OperationReason" followed by its pair - the value.
First, create the Hash: $hash = @{}
Then set the pair and value: $hash.Add{"Control"," Control value"}
Then run the desired cmdlet and send the -Control parameter using the $hash variable.
function disableUser($Request){
$hash = @{}
$hash.Add("OperationReason","DISABLED DUE TO EXPIRED GAL COMPLIANCE")
disable-QADUser -Identity $Request.dn -Control $hash -Proxy
}
© 2025 One Identity LLC. ALL RIGHTS RESERVED. Conditions d’utilisation Confidentialité Cookie Preference Center