We use cookies to improve your experience.
By your continued use of this site you accept such use.
For more details please see our privacy policy and cookies policy.

Script repository

Update the number of noise lines in captcha

October 31, 2023 Views: 1693

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.
  • $serviceHost - the host name of the computer where Adaxes service is installed.
  • $noiseLinesCount - Specifies the number of noise lines in captcha.
Edit Remove
PowerShell
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$webApplicationName = "HelpDesk" # TODO: modify me
$serviceHost = "localhost" # TODO: modify me
$noiseLevel = 10 # TODO: modify me

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

# Prompt for credentials.
$credential = Get-Credential

# Get WebUI configuration
$webuiConfigPath = $service.Backend.GetConfigurationContainerPath("WebUIConfigurationContainer")
$webuiConfigContainer = $service.OpenObject($webuiConfigPath, $credential.UserName, $credential.GetNetworkCredential().Password, 0)
$config = $webuiConfigContainer.GetConfig($webApplicationName)

# Update autologon
$json = '{ "bruteForceProtection": {"captchaSettings": {"noiseLevel": ' + $noiseLevel + '}}}'
$config.FromJson($null, $json)
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
Loading...

Got questions?

Support Questions & Answers