Script Repository


Update the number of noise lines in captcha

February 24, 2021
791

The script updates the number of noise lines in captcha displayed on the Sign In page of Adaxes Web interface. Execute the script in Windows PowerShell on the computer where Adaxes service is installed. When prompted, specify the credentials of the Adaxes service account (specified during Adaxes installation).

The script requires PowerShell 3.0 or later.

Parameters:

  • $webUIConfigurationName - Specifies the name of the Web interface whose configuration will be updated. To update the configuration of the Common Sign In page, specify CommonSignIn.
  • $noiseLinesCount - Specifies the number of noise lines in captcha.
Edit Remove
PowerShell
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$webUIConfigurationName = "HelpDesk" # TODO: modify me
$noiseLinesCount = 10 # TODO: modify me

# Bind to Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")

# Get Web Interface configuration
$webuiConfigPath = $admService.Backend.GetConfigurationContainerPath(
    "WebUIConfigurationContainer")

$credential = Get-Credential
$webuiConfigContainer = $admService.OpenObject($webuiConfigPath, $credential.UserName, $credential.GetNetworkCredential().Password, 0)
$webUIConfiguration = $webuiConfigContainer.GetConfiguration($webUIConfigurationName)

$signInBruteForceProtectionSettings = $webUIConfiguration.SignInBruteForceProtectionSettings
$captchaSettings = $signInBruteForceProtectionSettings.CaptchaSettings

# Set captcha noise lines count
$captchaSettings.NoiseLinesCount = $noiseLinesCount
$signInBruteForceProtectionSettings.CaptchaSettings = $captchaSettings
$webUIConfiguration.SignInBruteForceProtectionSettings = $signInBruteForceProtectionSettings

# Save the changes
$webUIConfiguration.SetInfo()

Comments ( 6 )
avatar
Ed
Feb 11, 2019
When I run this I get an error when trying to save the configuration :Cannot find an overload for "SetInfo" and the argument count: "0".
At line:27 char:1
avatar
Support
Feb 11, 2019

Hello Ed,

It looks like the issue occurs because of the PowerShell version. To check the version of PowerShell you are using, execute the following script:

Edit Remove
PowerShell
$PSVersionTable

If you are using version 5.0, you need to update PowerShell to remedy the issue. Alternatively, please provide us with the PowerShell version you are currently using.

avatar
Jake
Apr 03, 2019
Can you publish the supported version of PowerShell for this script?
avatar
Support
Apr 04, 2019

Hello Jake,

The script requires PowerShell 3.0 or later. Thank you for poiting this out, we added the information to the script description.

avatar
Philipp
Aug 20, 2020
What is the Name of the common sign in web interface? I need to change the captcha there.
avatar
Support
Aug 20, 2020

Hello Philipp,

To update the number of noise lines for the Common Sign In page, pass CommonSignIn to theĀ $webUIConfigurationName variable:

Edit Remove
PowerShell
$webUIConfigurationName = "CommonSignIn" # TODO: modify me
Leave a comment