Change password generation parameters

When creating a new password, for example during a password reset, Adaxes provides the option to generate a strong random password in one click. You can configure which characters are allowed in the generated password, and its minimum and maximum length.

Only Adaxes service administrators have the rights to change password generation parameters.

To change the parameters for password generation, use the following script. In the script:

  • $serviceHost – the host name of the computer where the Adaxes service is installed.

  • $params – password generation parameters.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"
$params = @{
    "minLength" = 8;
    "maxLength" = 12;
    "lowerChars" = "abcdefgijkmnopqrstwxyz";
    "upperChars" = "ABCDEFGHJKLMNPQRSTWXYZ";
    "numericChars" = "23456789";
    "specialChars" = "!%#";
    "otherChars" = "тÜé";
}

# Connect to the Adaxes service.
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the settings container.
$path = $service.Backend.GetConfigurationContainerPath("ConfigurationSetSettings")
$settings = $service.OpenObject($path, $credential.UserName,`
    $credential.GetNetworkCredential().Password, 0)

# Change parameter value.
$settings.FromJson("Adsi.PasswordGenerationSettings", ($params | ConvertTo-Json))

If the specified minimum password length is less than allowed by the password policy, the minimum length for password generation will be taken from the policy.

View current settings

To view the current password generation parameters, use the following script. In the script:

  • $serviceHost – the host name of the computer where the Adaxes service is installed.
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$serviceHost = "localhost"

# Connect to the Adaxes service.
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly($serviceHost)

# Prompt for credentials.
$credential = Get-Credential

# Bind to the settings container.
$path = $service.Backend.GetConfigurationContainerPath("ConfigurationSetSettings")
$settings = $service.OpenObject($path, $credential.UserName,`
    $credential.GetNetworkCredential().Password, 0)

# View parameter value.
$settings.ToJson("Adsi.PasswordGenerationSettings") | ConvertFrom-Json

See also