To enable storing of data for which there are no Active Directory attributes, Adaxes provides custom attributes of AD objects, such as, for example, CustomAttributeText1 or CustomAttributeInt1. The attributes are stored at Adaxes Configuration Server (AD LDS) and can be used with any Active Directory objects, such as users, groups, containers etc.
Adaxes service configuration is also stored on the configuration server in a directory container. Its custom attributes can also be used to store data. For example, it can store the last employee number assigned to a user in order to quickly assign the next one in sequence when creating the next user account.
For information on how to save a value in Adaxes configuration container, see Store data in Adaxes configuration.
This script outputs a numeric value stored in an attribute of the Adaxes configuration container. To use the code, create a custom command for Domain-DNS objects that runs the script and execute it on any of your AD domains. The value is added to the Execution Log of the operation that is displayed after the command completes.
Parameters:
- $queryPropertyName - Specifies the property of Adaxes configuration container that stores the value.
- $stringFomrat - Specifies how to format the output. For details, see Getting started with the String.Format method.
See Also: Create object names in sequential order.
$queryPropertyName = "adm-CustomAttributeInt1" # TODO: modify me
$stringFomrat = "PC-{0:000}" # TODO: modify me
# Get the number stored in the global configuration
$adaxesSettingsPath = $Context.GetWellKnownContainerPath("ConfigurationSetSettings")
$adaxesSettings = $Context.BindToObject($adaxesSettingsPath)
try
{
$value = [int]($settings.Get($queryPropertyName))
}
catch
{
$Context.LogMessage("The requested property is not assigned a value.", "Warning")
return
}
$valueOutput = [System.String]::Format($stringFomrat, $value)
$Context.LogMessage("Property value: $valueOutput", "Information")
For example I have my own script to generate pass phrases from a dictionary. Every time a custom command is run to reset a password (instead of the default reset password action) I have the pass phrase generator script run and generate a new passphrase for the next password reset.
Id like the Passphrase parameter to use the passphrase that is stored in the Adaxes configuration as the Default Value for the parameter.
You can use this script in a Scheduled task to get the value and then set it as default in a Custom Command parameter. Unfortunately, there is no possibility to make the value always be present in the parameter settings dynamically. If you have issues modifying the script accordingly, we will help you.
Sorry for the confusion, but we are not sure what exactly you mean. The thing is that the property value is set for the Adaxes Configuration container which is not available in the UI. Please, provide us with all the possible details about the behavior including the scripts you have. You can send the details to our support email: support[at]adaxes.com.